P4C
The P4 Compiler
Loading...
Searching...
No Matches
ir/configuration.h
1/*
2 * SPDX-FileCopyrightText: 2013 Barefoot Networks, Inc.
3 * Copyright 2013-present Barefoot Networks, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef IR_CONFIGURATION_H_
9#define IR_CONFIGURATION_H_
10
11namespace P4 {
12
16 public:
17 virtual ~P4CConfiguration() = default;
18
20 virtual int maximumWidthSupported() const = 0;
21
23 virtual int maximumArraySize() const = 0;
24};
25
26class DefaultP4CConfiguration : public P4CConfiguration {
27 public:
28 int maximumWidthSupported() const override { return 2048; }
29 int maximumArraySize() const override { return 256; }
30
32 static const DefaultP4CConfiguration &get() {
33 static DefaultP4CConfiguration instance;
34 return instance;
35 }
36
37 protected:
39};
40
41} // namespace P4
42
43#endif /* IR_CONFIGURATION_H_ */
Definition ir/configuration.h:26
static const DefaultP4CConfiguration & get()
Definition ir/configuration.h:32
int maximumArraySize() const override
Maximum size for a header stack array.
Definition ir/configuration.h:29
int maximumWidthSupported() const override
Maximum width supported for a bit field or integer.
Definition ir/configuration.h:28
Definition ir/configuration.h:15
virtual int maximumArraySize() const =0
Maximum size for a header stack array.
virtual int maximumWidthSupported() const =0
Maximum width supported for a bit field or integer.
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13