88 const IR::BFN::Pipe *pipe;
94 struct TableInstance {
95 explicit TableInstance(
const IR::MAU::Table *table) : tableInfo(table) {}
97 const IR::MAU::Table *tableInfo;
100 std::map<std::pair<gress_t, int>, std::vector<TableInstance>> by_stage;
102 std::pair<UniqueId, const Memories::Use *>>
104 profile_t init_apply(
const IR::Node *root)
override {
return MauInspector::init_apply(root); }
105 bool preorder(
const IR::MAU::Table *tbl)
override {
106 auto tableId = std::make_pair(tbl->gress, tbl->stage());
107 by_stage[tableId].push_back(TableInstance(tbl));
110 bool preorder(
const IR::MAU::BackendAttached *)
override {
118 void postorder(
const IR::MAU::Selector *as)
override {
120 auto tbl = findContext<IR::MAU::Table>();
121 if (tbl->is_placed()) {
122 auto &unattached = tbl->resources->memuse.at(tbl->unique_id()).unattached_tables;
123 auto unique_id = tbl->unique_id(as);
124 if (!unattached.count(unique_id) && tbl->resources->memuse.count(unique_id)) {
125 selector_memory[std::make_pair(tbl->stage(), as)] =
126 std::make_pair(unique_id, &tbl->resources->memuse.at(unique_id));
130 bool preorder(
const IR::MAU::StatefulAlu *)
override {
return false; }
131 friend std::ostream &operator<<(std::ostream &,
const MauAsmOutput &);
137 bool require_ixbar(
const IR::MAU::Table *tbl, IXBar::Use::type_t)
const;
138 bool require_ixbar(
const IR::MAU::Table *tbl, std::initializer_list<IXBar::Use::type_t>)
const;
139 void emit_ixbar(std::ostream &out,
indent_t indent,
const IR::MAU::Table *tbl,
140 IXBar::Use::type_t type)
const;
141 void emit_ixbar(std::ostream &out,
indent_t indent,
const IR::MAU::Table *tbl,
142 std::initializer_list<IXBar::Use::type_t> types)
const;
143 void emit_random_seed(std::ostream &out,
indent_t indent,
const TableMatch *fmt)
const;
145 void emit_hash_dist(std::ostream &out,
indent_t indent,
152 const IR::MAU::Table *tbl)
const;
155 bool gw_can_miss)
const;
162 const TableMatch *tm,
bool ternary,
bool no_match)
const;
166 const IR::MAU::Table::Layout *l =
nullptr,
169 void emit_table_context_json(std::ostream &out,
indent_t,
const IR::MAU::Table *tbl)
const;
171 void emit_atcam_match(std::ostream &out,
indent_t,
const IR::MAU::Table *tbl,
172 std::stringstream &context_json_entries)
const;
173 void emit_table(std::ostream &out,
const IR::MAU::Table *tbl,
int stage, gress_t gress)
const;
174 void emit_always_run_action(std::ostream &out,
const IR::MAU::Table *tbl,
int stage,
175 gress_t gress)
const;
176 void emit_static_entries(std::ostream &,
indent_t indent,
const IR::MAU::Table *tbl,
177 std::stringstream &context_json_entries)
const;
178 void next_table_non_action_map(
const IR::MAU::Table *,
180 void emit_table_indir(std::ostream &out,
indent_t,
const IR::MAU::Table *tbl,
181 const IR::MAU::TernaryIndirect *ti)
const;
182 void emit_action_data_format(std::ostream &out,
indent_t,
const IR::MAU::Table *tbl,
183 const IR::MAU::Action *af)
const;
188 const IR::MAU::Action *af)
const;
191 bool emit_idletime(std::ostream &out,
indent_t indent,
const IR::MAU::Table *tbl,
192 const IR::MAU::IdleTime *
id)
const;
193 void emit_indirect_res_context_json(std::ostream &,
indent_t indent,
const IR::MAU::Table *tbl,
194 std::stringstream &context_json_entries)
const;
195 virtual bool gateway_uses_inhibit_index(
const IR::MAU::Table *)
const {
return false; }
197 std::string indirect_pfe(
const IR::MAU::AttachedMemory *)
const;
198 std::string stateful_counter_addr(IR::MAU::StatefulUse use)
const;
199 std::string
build_call(
const IR::MAU::AttachedMemory *at_mem,
200 const IR::MAU::BackendAttached *ba,
const IR::MAU::Table *tbl)
const;
203 const IR::MAU::BackendAttached *ba,
204 const IR::MAU::Table *tbl)
const;
210 class UnattachedName;
216 : phv(phv), pipe(pipe), nxt_tbl(nxts), power_and_mpr(pmpr), options(options) {}
218 static cstring find_attached_name(
const IR::MAU::Table *tbl,
const IR::MAU::AttachedMemory *am);
220 const IR::MAU::AttachedMemory *am);
void emit_table_hitmap(std::ostream &out, indent_t indent, const IR::MAU::Table *tbl, NextTableSet &next_hit, NextTableSet &gw_miss, bool no_match_hit, bool gw_can_miss) const
Definition mau/asm_output.cpp:2554