P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4tools/modules/testgen/targets/bmv2/constants.h
1/*
2 * SPDX-FileCopyrightText: 2022 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_
9
10#include <cstdint>
11
13
14enum bmv2_gress_t { BMV2_INGRESS, BMV2_EGRESS };
15
17 public:
19 static constexpr const char *MATCH_KIND_OPT = "optional";
21 static constexpr const char *MATCH_KIND_SELECTOR = "selector";
23 static constexpr const char *MATCH_KIND_RANGE = "range";
28 static constexpr uint64_t PKT_INSTANCE_TYPE_NORMAL = 0x0000;
29 static constexpr uint64_t PKT_INSTANCE_TYPE_INGRESS_CLONE = 0x0001;
30 static constexpr uint64_t PKT_INSTANCE_TYPE_EGRESS_CLONE = 0x0002;
31 static constexpr uint64_t PKT_INSTANCE_TYPE_COALESCED = 0x0003;
32 static constexpr uint64_t PKT_INSTANCE_TYPE_RECIRC = 0x0004;
33 static constexpr uint64_t PKT_INSTANCE_TYPE_REPLICATION = 0x005;
34 static constexpr uint64_t PKT_INSTANCE_TYPE_RESUBMIT = 0x006;
37 static constexpr uint16_t CLONE_SESSION_ID_MIN = 1;
38 static constexpr uint16_t CLONE_SESSION_ID_MAX = 32767;
40 enum CloneType { I2E = 0, E2E = 1 };
42 enum METER_COLOR { GREEN = 0, YELLOW = 1, RED = 2 };
44 static constexpr int PORT_BIT_WIDTH = 9;
45
47 static constexpr int STF_MIN_PKT_SIZE = 22;
48 static constexpr int ETH_HDR_SIZE = 112;
49 static constexpr int DROP_PORT = 511;
50};
51
52} // namespace P4::P4Tools::P4Testgen::Bmv2
53
54#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_CONSTANTS_H_ */
Definition p4tools/modules/testgen/targets/bmv2/constants.h:16
CloneType
Clone type is derived from v1model.p4.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:40
static constexpr int STF_MIN_PKT_SIZE
Other useful constants.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:47
static constexpr const char * MATCH_KIND_RANGE
Entries that can match a range.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:23
static constexpr const char * MATCH_KIND_OPT
Match bits exactly or not at all.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:19
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:21
static constexpr uint64_t PKT_INSTANCE_TYPE_NORMAL
Definition p4tools/modules/testgen/targets/bmv2/constants.h:28
METER_COLOR
Meter colors are defined in v1model.p4.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:42
static constexpr uint16_t CLONE_SESSION_ID_MIN
Definition p4tools/modules/testgen/targets/bmv2/constants.h:37
static constexpr int PORT_BIT_WIDTH
Port width in bits.
Definition p4tools/modules/testgen/targets/bmv2/constants.h:44
Inja.
Definition targets/bmv2/cmd_stepper.cpp:37