P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4tools/modules/testgen/targets/bmv2/constants.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_
3
4#include <cstdint>
5
7
8enum bmv2_gress_t { BMV2_INGRESS, BMV2_EGRESS };
9
11 public:
13 static constexpr const char *MATCH_KIND_OPT = "optional";
15 static constexpr const char *MATCH_KIND_SELECTOR = "selector";
17 static constexpr const char *MATCH_KIND_RANGE = "range";
22 static constexpr uint64_t PKT_INSTANCE_TYPE_NORMAL = 0x0000;
23 static constexpr uint64_t PKT_INSTANCE_TYPE_INGRESS_CLONE = 0x0001;
24 static constexpr uint64_t PKT_INSTANCE_TYPE_EGRESS_CLONE = 0x0002;
25 static constexpr uint64_t PKT_INSTANCE_TYPE_COALESCED = 0x0003;
26 static constexpr uint64_t PKT_INSTANCE_TYPE_RECIRC = 0x0004;
27 static constexpr uint64_t PKT_INSTANCE_TYPE_REPLICATION = 0x005;
28 static constexpr uint64_t PKT_INSTANCE_TYPE_RESUBMIT = 0x006;
31 static constexpr uint16_t CLONE_SESSION_ID_MIN = 1;
32 static constexpr uint16_t CLONE_SESSION_ID_MAX = 32767;
34 enum CloneType { I2E = 0, E2E = 1 };
36 enum METER_COLOR { GREEN = 0, YELLOW = 1, RED = 2 };
38 static constexpr int PORT_BIT_WIDTH = 9;
39
41 static constexpr int STF_MIN_PKT_SIZE = 22;
42 static constexpr int ETH_HDR_SIZE = 112;
43 static constexpr int DROP_PORT = 511;
44};
45
46} // namespace P4::P4Tools::P4Testgen::Bmv2
47
48#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_ */
Definition p4tools/modules/testgen/targets/bmv2/constants.h:10
CloneType
Clone type is derived from v1model.p4.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:34
static constexpr int STF_MIN_PKT_SIZE
Other useful constants.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:41
static constexpr const char * MATCH_KIND_RANGE
Entries that can match a range.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:17
static constexpr const char * MATCH_KIND_OPT
Match bits exactly or not at all.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:13
static constexpr const char * MATCH_KIND_SELECTOR
A match that is used as an argument for the selector.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:15
static constexpr uint64_t PKT_INSTANCE_TYPE_NORMAL
Definition p4tools/modules/testgen/targets/bmv2/constants.h:22
METER_COLOR
Meter colors are defined in v1model.p4.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:36
static constexpr uint16_t CLONE_SESSION_ID_MIN
Definition p4tools/modules/testgen/targets/bmv2/constants.h:31
static constexpr int PORT_BIT_WIDTH
Port width in bits.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:38
Inja.
Definition targets/bmv2/cmd_stepper.cpp:33