P4C
The P4 Compiler
Loading...
Searching...
No Matches
parser_enforce_depth_req.h
1
19#ifndef BF_P4C_MIDEND_PARSER_ENFORCE_DEPTH_REQ_H_
20#define BF_P4C_MIDEND_PARSER_ENFORCE_DEPTH_REQ_H_
21
22#include "ir/ir.h"
23#include "midend/type_checker.h"
24
25namespace BFN {
26
37 public:
39 struct ParserPadReq {
40 // Parser instance is the key of the map below
41 // const IR::P4Parser *parser;
42 int minParseDepth;
43 int maxParseDepth;
44
47
55 std::map<cstring, bool> padStatesAccept;
56 std::map<cstring, bool> padStatesReject;
57 };
58
59 static const cstring pad_hdr_name;
60 static const cstring pad_hdr_type_name;
61 static const cstring pad_hdr_field;
62 static const cstring pad_ctr_name;
63 static const cstring pad_state_name;
64 static const cstring non_struct_pad_suf;
65
66 private:
67 P4::ReferenceMap *refMap;
68
69 BFN::EvaluatorPass *evaluator;
70
71 std::set<cstring> structs;
72 std::map<const IR::P4Parser *, ParserPadReq> padReq;
73 std::map<cstring, int> headerPadAmt;
74 std::map<const IR::P4Parser *, gress_t> all_parser;
75 std::map<const IR::P4Control *, gress_t> all_deparser;
76 std::map<const IR::P4Control *, gress_t> all_mau_pipe;
77 std::map<const IR::P4Control *, std::set<const IR::P4Parser *>> deparser_parser;
78 std::map<const IR::P4Control *, std::set<const IR::P4Parser *>> mau_pipe_parser;
79 std::map<const IR::P4Parser *, std::map<cstring, int>> stateSize;
80
81 int ctrShiftAmt;
82
83 public:
85};
86
87} // namespace BFN
88
89#endif /* BF_P4C_MIDEND_PARSER_ENFORCE_DEPTH_REQ_H_ */
Definition evaluator.h:115
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition cstring.h:85
int maxPadStates
Maximum pad states.
Definition parser_enforce_depth_req.h:46
std::map< cstring, bool > padStatesAccept
Definition parser_enforce_depth_req.h:55
Enforce parser min/max depth requirements.
Definition parser_enforce_depth_req.h:36
Pad requirements for a parser instance to enforce min parse depth.
Definition parser_enforce_depth_req.h:39
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21