50 const IR::ToplevelBlock *tlb;
51 IR::TCPipeline *tcPipeline;
55 unsigned int tableCount = 0;
56 unsigned int actionCount = 0;
57 unsigned int metadataCount = 0;
58 unsigned int labelCount = 0;
60 cstring mainParserName =
nullptr;
69 : tlb(tlb), tcPipeline(pipe), refMap(refMap), typeMap(typeMap), options(options) {}
70 void setPipelineName();
71 cstring getPipelineName() {
return pipelineName; };
72 bool preorder(
const IR::P4Program *p)
override;
73 void postorder(
const IR::P4Action *a)
override;
74 void postorder(
const IR::P4Table *t)
override;
75 void postorder(
const IR::P4Program *p)
override;
76 bool isDuplicateOrNoAction(
const IR::P4Action *action);
77 void updateDefaultHitAction(
const IR::P4Table *t, IR::TCTable *tdef);
78 void updateDefaultMissAction(
const IR::P4Table *t, IR::TCTable *tdef);
79 void updateConstEntries(
const IR::P4Table *t, IR::TCTable *tdef);
80 void updateMatchType(
const IR::P4Table *t, IR::TCTable *tabledef);
81 void updateTimerProfiles(IR::TCTable *tabledef);
83 bool isPnaMainInputMeta(
const IR::Member *mem);
84 bool isPnaMainOutputMeta(
const IR::Member *mem);
85 unsigned int findMappedKernelMeta(
const IR::Member *mem);
86 const IR::Expression *ExtractExpFromCast(
const IR::Expression *exp);
87 unsigned getTcType(
const IR::StringLiteral *sl);
88 unsigned getTableId(
cstring tableName)
const;
89 unsigned getActionId(
cstring actionName)
const;
90 unsigned getTableKeysize(
unsigned tableId)
const;
91 cstring externalName(
const IR::IDeclaration *declaration)
const;
92 void updateAddOnMissTable(
cstring tblname)
const {
93 for (
auto table : tcPipeline->tableDefs) {
94 if (table->tableName == tblname) {
95 ((IR::TCTable *)table)->setTableAddOnMiss();