Skip to content

Commit 487944d

Browse files
CHANX ---> t_rr_type::CHANX
1 parent 93e9758 commit 487944d

15 files changed

+56
-56
lines changed

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ void check_rr_graph(const RRGraphView& rr_graph,
154154
* - CHAN -> IPIN connections (unique rr_node for IPIN nodes on multiple sides)
155155
* - OPIN -> CHAN connections (unique rr_node for OPIN nodes on multiple sides)
156156
*/
157-
bool is_chan_to_chan = (rr_type == CHANX || rr_type == CHANY) && (to_rr_type == CHANY || to_rr_type == CHANX);
158-
bool is_chan_to_ipin = (rr_type == CHANX || rr_type == CHANY) && to_rr_type == t_rr_type::IPIN;
159-
bool is_opin_to_chan = rr_type == t_rr_type::OPIN && (to_rr_type == CHANX || to_rr_type == CHANY);
157+
bool is_chan_to_chan = (rr_type == t_rr_type::CHANX || rr_type == CHANY) && (to_rr_type == CHANY || to_rr_type == t_rr_type::CHANX);
158+
bool is_chan_to_ipin = (rr_type == t_rr_type::CHANX || rr_type == CHANY) && to_rr_type == t_rr_type::IPIN;
159+
bool is_opin_to_chan = rr_type == t_rr_type::OPIN && (to_rr_type == t_rr_type::CHANX || to_rr_type == CHANY);
160160
bool is_internal_edge = false;
161161
if (is_flat) {
162162
is_internal_edge = (rr_type == t_rr_type::IPIN && to_rr_type == t_rr_type::IPIN) || (rr_type == t_rr_type::OPIN && to_rr_type == t_rr_type::OPIN);
@@ -168,7 +168,7 @@ void check_rr_graph(const RRGraphView& rr_graph,
168168
}
169169

170170
//Between two wire segments
171-
VTR_ASSERT_MSG(to_rr_type == CHANX || to_rr_type == CHANY || to_rr_type == t_rr_type::IPIN, "Expect channel type or input pin type");
171+
VTR_ASSERT_MSG(to_rr_type == t_rr_type::CHANX || to_rr_type == CHANY || to_rr_type == t_rr_type::IPIN, "Expect channel type or input pin type");
172172
VTR_ASSERT_MSG(rr_type == CHANX || rr_type == CHANY || rr_type == t_rr_type::OPIN, "Expect channel type or output pin type");
173173

174174
//While multiple connections between the same wires can be electrically legal,

libs/librrgraph/src/base/rr_graph_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void RRGraphBuilder::add_node_to_all_locs(RRNodeId node) {
4141
case CHANY:
4242
node_lookup_.add_node(node, node_layer, ix, iy, node_type, node_ptc_num, TOTAL_2D_SIDES[0]);
4343
break;
44-
case CHANX:
44+
case t_rr_type::CHANX:
4545
/* Currently need to swap x and y for CHANX because of chan, seg convention
4646
* TODO: Once the builders is reworked for use consistent (x, y) convention,
4747
* the following swapping can be removed

libs/librrgraph/src/base/rr_graph_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ std::vector<RRSwitchId> find_rr_graph_switches(const RRGraph& rr_graph,
7676
}
7777

7878
int seg_index_of_cblock(const RRGraphView& rr_graph, t_rr_type from_rr_type, int to_node) {
79-
if (from_rr_type == CHANX)
79+
if (from_rr_type == t_rr_type::CHANX)
8080
return (rr_graph.node_xlow(RRNodeId(to_node)));
8181
else
8282
/* CHANY */
@@ -89,10 +89,10 @@ int seg_index_of_sblock(const RRGraphView& rr_graph, int from_node, int to_node)
8989
from_rr_type = rr_graph.node_type(RRNodeId(from_node));
9090
to_rr_type = rr_graph.node_type(RRNodeId(to_node));
9191

92-
if (from_rr_type == CHANX) {
92+
if (from_rr_type == t_rr_type::CHANX) {
9393
if (to_rr_type == CHANY) {
9494
return (rr_graph.node_xlow(RRNodeId(to_node)));
95-
} else if (to_rr_type == CHANX) {
95+
} else if (to_rr_type == t_rr_type::CHANX) {
9696
if (rr_graph.node_xlow(RRNodeId(to_node)) > rr_graph.node_xlow(RRNodeId(from_node))) { /* Going right */
9797
return (rr_graph.node_xhigh(RRNodeId(from_node)));
9898
} else { /* Going left */
@@ -107,7 +107,7 @@ int seg_index_of_sblock(const RRGraphView& rr_graph, int from_node, int to_node)
107107
}
108108
/* End from_rr_type is CHANX */
109109
else if (from_rr_type == CHANY) {
110-
if (to_rr_type == CHANX) {
110+
if (to_rr_type == t_rr_type::CHANX) {
111111
return (rr_graph.node_ylow(RRNodeId(to_node)));
112112
} else if (to_rr_type == CHANY) {
113113
if (rr_graph.node_ylow(RRNodeId(to_node)) > rr_graph.node_ylow(RRNodeId(from_node))) { /* Going up */

vpr/src/base/stats.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static void load_channel_occupancies(const Netlist<>& net_list,
312312
RRNodeId inode = rt_node.inode;
313313
t_rr_type rr_type = rr_graph.node_type(inode);
314314

315-
if (rr_type == CHANX) {
315+
if (rr_type == t_rr_type::CHANX) {
316316
int j = rr_graph.node_ylow(inode);
317317
for (int i = rr_graph.node_xlow(inode); i <= rr_graph.node_xhigh(inode); i++)
318318
chanx_occ[i][j]++;
@@ -354,11 +354,11 @@ void get_num_bends_and_length(ParentNetId inet, int* bends_ptr, int* len_ptr, in
354354
RRNodeId inode = rt_node.inode;
355355
t_rr_type curr_type = rr_graph.node_type(inode);
356356

357-
if (curr_type == CHANX || curr_type == CHANY) {
357+
if (curr_type == t_rr_type::CHANX || curr_type == CHANY) {
358358
segments++;
359359
length += rr_graph.node_length(inode);
360360

361-
if (curr_type != prev_type && (prev_type == CHANX || prev_type == CHANY))
361+
if (curr_type != prev_type && (prev_type == t_rr_type::CHANX || prev_type == CHANY))
362362
bends++;
363363
}
364364

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ struct t_det_routing_arch {
13621362
};
13631363

13641364
constexpr bool is_pin(e_rr_type type) { return (type == t_rr_type::IPIN || type == OPIN); }
1365-
constexpr bool is_chan(e_rr_type type) { return (type == CHANX || type == CHANY); }
1365+
constexpr bool is_chan(e_rr_type type) { return (type == t_rr_type::CHANX || type == CHANY); }
13661366
constexpr bool is_src_sink(e_rr_type type) { return (type == t_rr_type::SOURCE || type == t_rr_type::SINK); }
13671367

13681368
/**

vpr/src/draw/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ int get_track_num(int inode, const vtr::OffsetMatrix<int>& chanx_track, const vt
638638
j = rr_graph.node_ylow(rr_node); /* length channel segments. */
639639

640640
switch (rr_type) {
641-
case CHANX:
641+
case t_rr_type::CHANX:
642642
return (chanx_track[i][j]);
643643

644644
case CHANY:

vpr/src/draw/draw_basic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void draw_congestion(ezgl::renderer* g) {
351351
color.alpha = transparency_factor;
352352

353353
switch (rr_graph.node_type(inode)) {
354-
case CHANX: //fallthrough
354+
case t_rr_type::CHANX: //fallthrough
355355
case CHANY:
356356
draw_rr_chan(inode, color, g);
357357
break;
@@ -667,15 +667,15 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
667667
}
668668
break;
669669
}
670-
case CHANX: {
670+
case t_rr_type::CHANX: {
671671
if (draw_state->draw_route_type == GLOBAL)
672672
chanx_track[rr_graph.node_xlow(inode)][rr_graph.node_ylow(inode)]++;
673673

674674
draw_rr_chan(inode, color, g);
675675
if (edge_visibility.visible) {
676676
g->set_color(color, edge_visibility.alpha);
677677
switch (prev_type) {
678-
case CHANX: {
678+
case t_rr_type::CHANX: {
679679
draw_chanx_to_chanx_edge(prev_node, inode, switch_type, g);
680680
break;
681681
}
@@ -706,7 +706,7 @@ void draw_partial_route(const std::vector<RRNodeId>& rr_nodes_to_draw, ezgl::ren
706706
if (edge_visibility.visible) {
707707
g->set_color(color, edge_visibility.alpha);
708708
switch (prev_type) {
709-
case CHANX: {
709+
case t_rr_type::CHANX: {
710710
draw_chanx_to_chany_edge(prev_node, inode,
711711
FROM_X_TO_Y, switch_type, g);
712712
break;
@@ -839,10 +839,10 @@ void draw_routing_util(ezgl::renderer* g) {
839839
t_draw_coords* draw_coords = get_draw_coords_vars();
840840
auto& device_ctx = g_vpr_ctx.device();
841841

842-
auto chanx_usage = calculate_routing_usage(CHANX, draw_state->is_flat, false);
842+
auto chanx_usage = calculate_routing_usage(t_rr_type::CHANX, draw_state->is_flat, false);
843843
auto chany_usage = calculate_routing_usage(CHANY, draw_state->is_flat, false);
844844

845-
auto chanx_avail = calculate_routing_avail(CHANX);
845+
auto chanx_avail = calculate_routing_avail(t_rr_type::CHANX);
846846
auto chany_avail = calculate_routing_avail(CHANY);
847847

848848
float min_util = 0.;

vpr/src/draw/draw_rr.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void draw_rr(ezgl::renderer* g) {
6262
if (!draw_state->draw_rr_node[inode].node_highlighted) {
6363
/* If not highlighted node, assign color based on type. */
6464
switch (rr_graph.node_type(inode)) {
65-
case CHANX:
65+
case t_rr_type::CHANX:
6666
case CHANY:
6767
draw_state->draw_rr_node[inode].color = DEFAULT_RR_NODE_COLOR;
6868
break;
@@ -98,7 +98,7 @@ void draw_rr(ezgl::renderer* g) {
9898
draw_rr_src_sink(inode, draw_state->draw_rr_node[inode].color, g);
9999
break;
100100

101-
case CHANX:
101+
case t_rr_type::CHANX:
102102
draw_rr_chan(inode, draw_state->draw_rr_node[inode].color, g);
103103
draw_rr_edges(inode, g);
104104
break;
@@ -135,7 +135,7 @@ void draw_rr_chan(RRNodeId inode, const ezgl::color color, ezgl::renderer* g) {
135135

136136
t_rr_type type = rr_graph.node_type(inode);
137137

138-
VTR_ASSERT(type == CHANX || type == CHANY);
138+
VTR_ASSERT(type == t_rr_type::CHANX || type == CHANY);
139139

140140
ezgl::rectangle bound_box = draw_get_rr_chan_bbox(inode);
141141
Direction dir = rr_graph.node_direction(inode);
@@ -163,7 +163,7 @@ void draw_rr_chan(RRNodeId inode, const ezgl::color color, ezgl::renderer* g) {
163163
e_side mux_dir = TOP;
164164
int coord_min = -1;
165165
int coord_max = -1;
166-
if (type == CHANX) {
166+
if (type == t_rr_type::CHANX) {
167167
coord_min = rr_graph.node_xlow(inode);
168168
coord_max = rr_graph.node_xhigh(inode);
169169
if (dir == Direction::INC) {
@@ -201,7 +201,7 @@ void draw_rr_chan(RRNodeId inode, const ezgl::color color, ezgl::renderer* g) {
201201

202202
ezgl::point2d arrow_loc_min(0, 0);
203203
ezgl::point2d arrow_loc_max(0, 0);
204-
if (type == CHANX) {
204+
if (type == t_rr_type::CHANX) {
205205
float sb_xmin = draw_coords->tile_x[k];
206206
arrow_loc_min = {sb_xmin + arrow_offset, start.y};
207207

@@ -303,7 +303,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
303303
switch (from_type) {
304304
case t_rr_type::OPIN:
305305
switch (to_type) {
306-
case CHANX:
306+
case t_rr_type::CHANX:
307307
case CHANY:
308308
if (rgb_is_same(draw_state->draw_rr_node[inode].color, ezgl::MAGENTA)) {
309309
// If OPIN was clicked on, set color to fan-out
@@ -338,7 +338,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
338338
}
339339
break;
340340

341-
case CHANX: /* from_type */
341+
case t_rr_type::CHANX: /* from_type */
342342
switch (to_type) {
343343
case t_rr_type::IPIN:
344344
if (draw_state->draw_rr_toggle == DRAW_NODES_SBOX_RR) {
@@ -365,7 +365,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
365365
draw_pin_to_chan_edge(to_node, inode, g);
366366
break;
367367

368-
case CHANX:
368+
case t_rr_type::CHANX:
369369
if (rgb_is_same(draw_state->draw_rr_node[inode].color, ezgl::MAGENTA)) {
370370
ezgl::color color = draw_state->draw_rr_node[to_node].color;
371371
g->set_color(color, transparency_factor);
@@ -435,7 +435,7 @@ void draw_rr_edges(RRNodeId inode, ezgl::renderer* g) {
435435
draw_pin_to_chan_edge(to_node, inode, g);
436436
break;
437437

438-
case CHANX:
438+
case t_rr_type::CHANX:
439439
if (rgb_is_same(draw_state->draw_rr_node[inode].color, ezgl::MAGENTA)) {
440440
ezgl::color color = draw_state->draw_rr_node[to_node].color;
441441
g->set_color(color, transparency_factor);
@@ -721,7 +721,7 @@ RRNodeId draw_check_rr_node_hit(float click_x, float click_y) {
721721
}
722722
break;
723723
}
724-
case CHANX:
724+
case t_rr_type::CHANX:
725725
case CHANY: {
726726
bound_box = draw_get_rr_chan_bbox(inode);
727727

@@ -815,7 +815,7 @@ void draw_rr_costs(ezgl::renderer* g, const vtr::vector<RRNodeId, float>& rr_cos
815815
color.alpha = transparency_factor;
816816

817817
switch (rr_graph.node_type(inode)) {
818-
case CHANX: //fallthrough
818+
case t_rr_type::CHANX: //fallthrough
819819
case CHANY:
820820
draw_rr_chan(inode, color, g);
821821
if (with_edges) draw_rr_edges(inode, g);

vpr/src/route/check_route.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static bool check_adjacent(RRNodeId from_node, RRNodeId to_node, bool is_flat) {
355355

356356
case t_rr_type::OPIN:
357357
from_grid_type = device_ctx.grid.get_physical_type({from_xlow, from_ylow, from_layer});
358-
if (to_type == CHANX || to_type == CHANY) {
358+
if (to_type == t_rr_type::CHANX || to_type == CHANY) {
359359
num_adj += 1; //adjacent
360360
} else if (is_flat) {
361361
VTR_ASSERT(to_type == t_rr_type::OPIN || to_type == t_rr_type::IPIN); // If pin is located inside a cluster
@@ -403,10 +403,10 @@ static bool check_adjacent(RRNodeId from_node, RRNodeId to_node, bool is_flat) {
403403
}
404404
break;
405405

406-
case CHANX:
406+
case t_rr_type::CHANX:
407407
if (to_type == IPIN) {
408408
num_adj += 1; //adjacent
409-
} else if (to_type == CHANX) {
409+
} else if (to_type == t_rr_type::CHANX) {
410410
from_xhigh = rr_graph.node_xhigh(from_node);
411411
to_xhigh = rr_graph.node_xhigh(to_node);
412412
if (from_ylow == to_ylow) {

vpr/src/route/connection_router.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void ConnectionRouter<Heap>::evaluate_timing_driven_node_costs(RTExploredNode* t
772772
if (cost_params.bend_cost != 0.) {
773773
t_rr_type from_type = rr_graph_->node_type(from_node);
774774
t_rr_type to_type = rr_graph_->node_type(to->index);
775-
if ((from_type == CHANX && to_type == CHANY) || (from_type == CHANY && to_type == CHANX)) {
775+
if ((from_type == t_rr_type::CHANX && to_type == CHANY) || (from_type == CHANY && to_type == t_rr_type::CHANX)) {
776776
to->backward_path_cost += cost_params.bend_cost; //Bend cost
777777
}
778778
}
@@ -1012,7 +1012,7 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
10121012
// Expand HF BB to include the node (clip by original BB)
10131013
expand_highfanout_bounding_box(highfanout_bb, net_bounding_box, rr_node_to_add, rr_graph_);
10141014

1015-
if (rr_graph_->node_type(rr_node_to_add) == CHANY || rr_graph_->node_type(rr_node_to_add) == CHANX) {
1015+
if (rr_graph_->node_type(rr_node_to_add) == CHANY || rr_graph_->node_type(rr_node_to_add) == t_rr_type::CHANX) {
10161016
chan_nodes_added++;
10171017
}
10181018
}
@@ -1047,7 +1047,7 @@ static inline bool relevant_node_to_target(const RRGraphView* rr_graph,
10471047
RRNodeId target_node) {
10481048
VTR_ASSERT_SAFE(rr_graph->node_type(target_node) == t_rr_type::SINK);
10491049
auto node_to_add_type = rr_graph->node_type(node_to_add);
1050-
return node_to_add_type != t_rr_type::t_rr_type::IPIN || node_in_same_physical_tile(node_to_add, target_node);
1050+
return node_to_add_type != t_rr_type::IPIN || node_in_same_physical_tile(node_to_add, target_node);
10511051
}
10521052

10531053
static inline void update_router_stats(RouterStats* router_stats,

vpr/src/route/overuse_report.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void report_overused_nodes(const Netlist<>& net_list,
139139
x -= g_vpr_ctx.device().grid.get_physical_type({x, y, layer_num})->width;
140140
y -= g_vpr_ctx.device().grid.get_physical_type({x, y, layer_num})->width;
141141
break;
142-
case CHANX:
142+
case t_rr_type::CHANX:
143143
case CHANY:
144144
report_overused_chanx_chany(os, node_id);
145145
break;

vpr/src/route/router_lookahead_compressed_map.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ static void compute_router_wire_compressed_lookahead(const std::vector<t_segment
149149
std::map<t_rr_type, std::vector<RRNodeId>> sample_nodes;
150150
std::vector<e_rr_type> chan_types;
151151
if (segment_inf.parallel_axis == X_AXIS)
152-
chan_types.push_back(CHANX);
152+
chan_types.push_back(t_rr_type::CHANX);
153153
else if (segment_inf.parallel_axis == Y_AXIS)
154154
chan_types.push_back(CHANY);
155155
else //Both for BOTH_AXIS segments and special segments such as clock_networks we want to search in both directions.
156-
chan_types.insert(chan_types.end(), {CHANX, CHANY});
156+
chan_types.insert(chan_types.end(), {t_rr_type::CHANX, CHANY});
157157

158158
for (e_rr_type chan_type : chan_types) {
159159
util::t_routing_cost_map routing_cost_map = util::get_routing_cost_map(longest_seg_length,
@@ -381,7 +381,7 @@ static util::Cost_Entry get_nearby_cost_entry_average_neighbour(const std::map<i
381381
}
382382

383383
static util::Cost_Entry get_wire_cost_entry_compressed_lookahead(e_rr_type rr_type, int seg_index, int from_layer_num, int delta_x, int delta_y, int to_layer_num) {
384-
VTR_ASSERT_SAFE(rr_type == CHANX || rr_type == CHANY);
384+
VTR_ASSERT_SAFE(rr_type == t_rr_type::CHANX || rr_type == CHANY);
385385

386386
int chan_index = 0;
387387
if (rr_type == CHANY) {
@@ -410,7 +410,7 @@ float CompressedMapLookahead::get_expected_cost(RRNodeId current_node, RRNodeId
410410
float delay_cost = 0.;
411411
float cong_cost = 0.;
412412

413-
if (from_rr_type == CHANX || from_rr_type == CHANY || from_rr_type == t_rr_type::SOURCE || from_rr_type == t_rr_type::OPIN) {
413+
if (from_rr_type == t_rr_type::CHANX || from_rr_type == CHANY || from_rr_type == t_rr_type::SOURCE || from_rr_type == t_rr_type::OPIN) {
414414
// Get the total cost using the combined delay and congestion costs
415415
std::tie(delay_cost, cong_cost) = get_expected_delay_and_cong(current_node, target_node, params, R_upstream);
416416
return delay_cost + cong_cost;
@@ -472,7 +472,7 @@ std::pair<float, float> CompressedMapLookahead::get_expected_delay_and_cong(RRNo
472472
.c_str())
473473
.c_str());
474474

475-
} else if (from_type == CHANX || from_type == CHANY) {
475+
} else if (from_type == t_rr_type::CHANX || from_type == CHANY) {
476476
//When estimating costs from a wire, we directly look-up the result in the wire lookahead (f_wire_cost_map)
477477

478478
auto from_cost_index = rr_graph.node_cost_index(from_node);

0 commit comments

Comments
 (0)