62 const IR::P4Table *table;
63 const IR::MethodCallExpression *call;
65 : refMap(refMap), typeMap(typeMap), table(
nullptr), call(
nullptr) {
68 setName(
"HasTableApply");
70 void postorder(
const IR::MethodCallExpression *expression)
override {
72 if (!mi->isApply())
return;
74 if (!am->object->is<IR::P4Table>())
return;
75 BUG_CHECK(table ==
nullptr,
"%1% and %2%: multiple table applications in one expression",
77 table = am->object->to<IR::P4Table>();
79 LOG3(
"Invoked table is " << dbp(table));
81 bool preorder(
const IR::Member *member)
override {
82 if (member->member ==
"hit" || member->member ==
"miss")
return true;
146 static const std::set<unsigned> valid_partition_values;
147 std::set<cstring> alpm_tables;
148 std::map<cstring, cstring> preclassifier_tables;
150 const IR::MAU::Table *create_pre_classifier_tcam(IR::MAU::Table *tbl, IR::TempVar *tv,
151 IR::TempVar *tk,
unsigned partition_index_bits,
152 unsigned pre_classifer_number_entries,
153 unsigned pre_classifer_number_actions);
154 bool values_through_pragmas(
const IR::P4Table *tbl,
int &number_of_partitions,
155 int &number_subtrees_par_partition);
156 bool values_through_impl(
const IR::P4Table *tbl,
int &number_of_partitions,
157 int &number_subtrees_per_partition,
int &atcam_subset_width,
158 int &shift_granularity);
161 const IR::Node *postorder(IR::P4Table *tbl)
override;
162 const IR::Node *postorder(IR::MethodCallStatement *)
override;
163 const IR::Node *postorder(IR::IfStatement *)
override;
164 const IR::Node *postorder(IR::SwitchStatement *)
override;
167 unsigned,
unsigned,
unsigned,
168 const IR::Expression *);
173 const IR::Expression *);
174 const IR::P4Table *create_preclassifier_table(
const IR::P4Table *,
unsigned,
unsigned,
unsigned,
176 const IR::P4Table *create_atcam_table(
const IR::P4Table *,
unsigned,
unsigned,
unsigned,
int,
178 const IR::Expression *);
179 void apply_pragma_exclude_msbs(
const IR::P4Table *tbl,
182 const IR::StatOrDecl *synth_funnel_shift_ops(
const IR::P4Table *,
const IR::Expression *,
int);
183 bool use_funnel_shift(
int);
186 static const cstring ALGORITHMIC_LPM_PARTITIONS;
187 static const cstring ALGORITHMIC_LPM_SUBTREES_PER_PARTITION;
188 static const cstring ALGORITHMIC_LPM_ATCAM_EXCLUDE_FIELD_MSBS;
191 : alpm_info(
info), refMap(refMap), typeMap(typeMap) {}
static MethodInstance * resolve(const IR::MethodCallExpression *mce, const DeclarationLookup *refMap, TypeMap *typeMap, bool useExpressionType=false, const Visitor::Context *ctxt=nullptr, bool incomplete=false)
Definition methodInstance.cpp:27
void info(const int kind, const char *format, const T *node, Args &&...args)
Report info messages of type kind. Requires that the node argument have source info.
Definition lib/error.h:148