23void MatchTable::write_next_table_regs(Target::JBay::mau_regs ®s,
Table *tbl) {
24 auto &merge = regs.rams.match.merge;
25 if (!hit_next.empty() || !extra_next_lut.empty()) {
26 merge.next_table_map_en |= (1U << logical_id);
28 for (
auto &n : hit_next) {
29 merge.pred_map_loca[logical_id][i].pred_map_loca_next_table = n.next_table_id();
30 merge.pred_map_loca[logical_id][i].pred_map_loca_exec =
31 n.next_in_stage(stage->stageno) >> 1;
32 merge.pred_map_glob[logical_id][i].pred_map_glob_exec =
33 n.next_in_stage(stage->stageno + 1);
34 merge.pred_map_glob[logical_id][i].pred_map_long_brch |= n.long_branch_tags();
37 for (
auto &n : extra_next_lut) {
38 merge.pred_map_loca[logical_id][i].pred_map_loca_next_table = n.next_table_id();
39 merge.pred_map_loca[logical_id][i].pred_map_loca_exec =
40 n.next_in_stage(stage->stageno) >> 1;
41 merge.pred_map_glob[logical_id][i].pred_map_glob_exec =
42 n.next_in_stage(stage->stageno + 1);
43 merge.pred_map_glob[logical_id][i].pred_map_long_brch |= n.long_branch_tags();
47 while (i < Target::NEXT_TABLE_SUCCESSOR_TABLE_DEPTH())
48 merge.pred_map_loca[logical_id][i++].pred_map_loca_next_table = 0x1ff;
51 merge.next_table_format_data[logical_id].match_next_table_adr_mask = next_table_adr_mask;
52 merge.next_table_format_data[logical_id].match_next_table_adr_miss_value =
53 miss_next.next_table_id();
54 merge.pred_miss_exec[logical_id].pred_miss_loca_exec =
55 miss_next.next_in_stage(stage->stageno) >> 1;
56 merge.pred_miss_exec[logical_id].pred_miss_glob_exec =
57 miss_next.next_in_stage(stage->stageno + 1);
58 merge.pred_miss_long_brch[logical_id] = miss_next.long_branch_tags();
62void MatchTable::write_regs(Target::JBay::mau_regs ®s,
int type,
Table *result) {
63 write_common_regs<Target::JBay>(regs, type, result);
65 auto &merge = regs.rams.match.merge;
66 if (gress == GHOST) merge.pred_ghost_thread |= 1 << logical_id;
67 merge.pred_glob_exec_thread[gress] |= 1 << logical_id;
68 if (always_run || pred.empty()) merge.pred_always_run[gress] |= 1 << logical_id;
70 if (long_branch_input >= 0)
71 setup_muxctl(merge.pred_long_brch_lt_src[logical_id], long_branch_input);
73 if (result ==
nullptr) result =
this;
75 bool is_branch = (miss_next.next_table() !=
nullptr);
76 if (!is_branch && gateway && gateway->is_branch()) is_branch =
true;
78 for (
auto &n : hit_next)
79 if (n.next_table() !=
nullptr) {
84 for (
auto &n : extra_next_lut)
85 if (n.next_table() !=
nullptr) {
90 if (!is_branch && result->get_format_field_size(
"next") > 3) is_branch =
true;
117 for (
auto &act : *result->actions) {
118 if (act.next_table_miss_ref.next_table()) {
125 if (is_branch) merge.pred_is_a_brch |= 1 << logical_id;
127 merge.mpr_glob_exec_thread |= merge.logical_table_thread[0].logical_table_thread_egress &
128 ~merge.logical_table_thread[0].logical_table_thread_ingress &
129 ~merge.pred_ghost_thread;