P4C
The P4 Compiler
Loading...
Searching...
No Matches
ir_enums.h
1
19#ifndef BF_P4C_IR_IR_ENUMS_H_
20#define BF_P4C_IR_IR_ENUMS_H_
21
22#include <lib/cstring.h>
23
24#include <iostream>
25
26namespace P4 {
27namespace IR {
28namespace MAU {
29enum class DataAggregation { NONE, PACKETS, BYTES, BOTH, AGGR_TYPES };
30enum class MeterType {
31 UNUSED = 0,
32 // we use explicit constants here to map to the meter types defined by hardware
33 // these are (currently) consistent across tofino1/2, but perhaps should be
34 // moved to the Device model
35 COLOR_BLIND = 2,
36 SELECTOR = 4,
37 COLOR_AWARE = 6,
38 STFUL_INST0 = 1,
39 STFUL_INST1 = 3,
40 STFUL_INST2 = 5,
41 STFUL_INST3 = 7,
42 STFUL_CLEAR = 6,
43 METER_TYPES = 8
44};
45enum class StatefulUse {
46 NO_USE,
47 DIRECT,
48 INDIRECT,
49 LOG,
50 STACK_PUSH,
51 STACK_POP,
52 FIFO_PUSH,
53 FIFO_POP,
54 FAST_CLEAR,
55 STFUL_TYPES
56};
57enum class AddrLocation { DIRECT, OVERHEAD, HASH, STFUL_COUNTER, GATEWAY_PAYLOAD, NOT_SET };
58enum class PfeLocation { DEFAULT, OVERHEAD, GATEWAY_PAYLOAD, NOT_SET };
59enum class TypeLocation { DEFAULT, OVERHEAD, GATEWAY_PAYLOAD, NOT_SET };
60enum class ColorMapramAddress { IDLETIME, STATS, MAPRAM_ADDR_TYPES, NOT_SET };
61enum class SelectorMode { FAIR, RESILIENT, SELECTOR_MODES };
62
65enum class AlwaysRun {
67 NONE,
69 TABLE,
71 ACTION
72};
73
74std::ostream &operator<<(std::ostream &out, const IR::MAU::DataAggregation &d);
75bool operator>>(cstring s, IR::MAU::DataAggregation &d);
76
77std::ostream &operator<<(std::ostream &out, const IR::MAU::MeterType &m);
78bool operator>>(cstring s, IR::MAU::MeterType &m);
79
80std::ostream &operator<<(std::ostream &out, const IR::MAU::StatefulUse &u);
81bool operator>>(cstring s, IR::MAU::StatefulUse &u);
82
83std::ostream &operator<<(std::ostream &out, const IR::MAU::AddrLocation &a);
84bool operator>>(cstring s, IR::MAU::AddrLocation &a);
85
86std::ostream &operator<<(std::ostream &out, const IR::MAU::PfeLocation &p);
87bool operator>>(cstring s, IR::MAU::PfeLocation &a);
88
89std::ostream &operator<<(std::ostream &out, const IR::MAU::TypeLocation &t);
90bool operator>>(cstring s, IR::MAU::TypeLocation &t);
91
92std::ostream &operator<<(std::ostream &out, const IR::MAU::ColorMapramAddress &cma);
93bool operator>>(cstring s, IR::MAU::ColorMapramAddress &cma);
94
95std::ostream &operator<<(std::ostream &out, const IR::MAU::SelectorMode &sm);
96bool operator>>(cstring s, IR::MAU::SelectorMode &sm);
97std::ostream &operator<<(std::ostream &out, const IR::MAU::AlwaysRun &ar);
98bool operator>>(cstring s, IR::MAU::AlwaysRun &ar);
99
100} // end namespace MAU
101
102namespace BFN {
103
105enum class ChecksumMode { VERIFY, RESIDUAL, CLOT };
106
108enum class ParserWriteMode { SINGLE_WRITE, BITWISE_OR, CLEAR_ON_WRITE };
109
110std::ostream &operator<<(std::ostream &out, const IR::BFN::ChecksumMode &t);
111bool operator>>(cstring s, IR::BFN::ChecksumMode &t);
112
113std::ostream &operator<<(std::ostream &out, const IR::BFN::ParserWriteMode &t);
114bool operator>>(cstring s, IR::BFN::ParserWriteMode &t);
115
116} // end namespace BFN
117
118} // end namespace IR
119
120} // end namespace P4
121
122#endif /* BF_P4C_IR_IR_ENUMS_H_ */
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
The namespace encapsulating IR node classes.
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24