P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4_refers_to_parser.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_P4_REFERS_TO_PARSER_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_P4_REFERS_TO_PARSER_H_
3
4#include "backends/p4tools/common/lib/variables.h"
5#include "ir/ir.h"
6#include "ir/visitor.h"
7
9
10class RefersToParser : public Inspector {
11 private:
13 ConstraintsVector restrictionsVector;
14
16 using RefersToBuiltinMap = std::map<cstring, std::map<cstring, IR::SymbolicVariable>>;
17 static const RefersToBuiltinMap REFERS_TO_BUILTIN_MAP;
18
21 static cstring assembleKeyReference(const IR::Vector<IR::AnnotationToken> &annotationList,
22 size_t offset);
23
25 static const IR::SymbolicVariable *lookUpBuiltinKey(
26 const IR::Annotation &refersAnno, const IR::Vector<IR::AnnotationToken> &annotationList);
27
29 static const IR::SymbolicVariable *lookUpKeyInTable(const IR::P4Table &srcTable,
30 cstring keyReference);
31
36 static const IR::SymbolicVariable *getReferencedKey(const IR::P4Control &ctrlContext,
37 const IR::Annotation &refersAnno);
38
39 bool preorder(const IR::P4Table *table) override;
40
41 public:
43
45 [[nodiscard]] ConstraintsVector getRestrictionsVector() const;
46};
47
48} // namespace P4::P4Tools::P4Testgen::Bmv2
49
50#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_P4_REFERS_TO_PARSER_H_ */
Definition vector.h:59
Definition visitor.h:400
Definition p4_refers_to_parser.h:10
ConstraintsVector getRestrictionsVector() const
Returns the restrictions imposed on the control-plane.
Definition p4_refers_to_parser.cpp:177
Definition cstring.h:85
Inja.
Definition targets/bmv2/cmd_stepper.cpp:33
std::vector< const IR::Expression * > ConstraintsVector
Definition variables.h:17