19#ifndef BF_P4C_ARCH_FROMV1_0_PHASE0_H_
20#define BF_P4C_ARCH_FROMV1_0_PHASE0_H_
23#include "ir/pass_manager.h"
32class TnaProgramStructure;
66typedef std::map<const IR::BFN::TnaParser *, const IR::Type_StructLike *> Phase0CallMap;
76 Phase0CallMap *phase0_calls)
77 : refMap(refMap), typeMap(typeMap), phase0_calls(phase0_calls) {
78 setName(
"CheckPhaseZeroExtern");
82 bool preorder(
const IR::MethodCallExpression *expr)
override;
86 Phase0CallMap *phase0_calls;
89using Phase0AnnotMap = std::map<cstring, cstring>;
94 : phase0_name_annot(name), phase0_action_annot(action) {
98 bool preorder(
const IR::ParserState *state)
override;
99 Phase0AnnotMap *phase0_name_annot;
100 Phase0AnnotMap *phase0_action_annot;
107 Phase0AnnotMap *phase0_name_annot,
108 Phase0AnnotMap *phase0_action_annot)
109 : phase0_calls(phase0_calls),
111 phase0_name_annot(phase0_name_annot),
112 phase0_action_annot(phase0_action_annot) {
113 setName(
"UpdatePhase0NodeInParser");
120 IR::BFN::TnaParser *preorder(IR::BFN::TnaParser *parser)
override;
122 Phase0CallMap *phase0_calls;
124 Phase0AnnotMap *phase0_name_annot;
125 Phase0AnnotMap *phase0_action_annot;
126 int phase0_count = 0;
134 setName(
"UpdatePhase0Header");
138 IR::Node *preorder(IR::Type_Struct *s)
override {
139 if (
auto *d = declarations->getDeclaration(s->name.toString())) {
140 LOG4(
"modifying struct " << s <<
" to header " << d->to<IR::Type_Header>());
171 : refMap(refMap), typeMap(typeMap) {
172 setName(
"ConvertPhase0MceToExtract");
176 IR::MethodCallExpression *generate_phase0_extract_method_call(
177 const IR::Expression *lExpr,
const IR::MethodCallExpression *rExpr);
178 IR::Node *preorder(IR::MethodCallExpression *expr)
override;
179 IR::Node *preorder(IR::AssignmentStatement *stmt)
override;
188 auto *phase0_calls =
new Phase0CallMap();
190 auto *phase0_name_annot =
new Phase0AnnotMap();
191 auto *phase0_action_annot =
new Phase0AnnotMap();
196 phase0_action_annot),
203cstring getDefaultPhase0TableKeyName();
Definition arch/fromv1.0/phase0.h:73
Definition arch/fromv1.0/phase0.h:91
Definition arch/fromv1.0/phase0.h:185
Definition arch/fromv1.0/phase0.h:103
Definition backends/tofino/bf-p4c/arch/fromv1.0/programStructure.h:110
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition arch/fromv1.0/phase0.h:61