Skip to content

Commit f6bb417

Browse files
a few remaining t_rr_type vals
1 parent 88787fb commit f6bb417

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

libs/librrgraph/src/base/check_rr_graph.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void check_rr_graph(const RRGraphView& rr_graph,
169169

170170
//Between two wire segments
171171
VTR_ASSERT_MSG(to_rr_type == t_rr_type::CHANX || to_rr_type == t_rr_type::CHANY || to_rr_type == t_rr_type::IPIN, "Expect channel type or input pin type");
172-
VTR_ASSERT_MSG(rr_type == CHANX || rr_type == t_rr_type::CHANY || rr_type == t_rr_type::OPIN, "Expect channel type or output pin type");
172+
VTR_ASSERT_MSG(rr_type == t_rr_type::CHANX || rr_type == t_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,
175175
//they are redundant if they are of the same switch type.
@@ -190,8 +190,8 @@ void check_rr_graph(const RRGraphView& rr_graph,
190190
/* Redundant edges are not allowed for chan <-> chan connections
191191
* but allowed for input pin <-> chan or output pin <-> chan connections
192192
*/
193-
if ((to_rr_type == CHANX || to_rr_type == t_rr_type::CHANY)
194-
&& (rr_type == CHANX || rr_type == t_rr_type::CHANY)) {
193+
if ((to_rr_type == t_rr_type::CHANX || to_rr_type == t_rr_type::CHANY)
194+
&& (rr_type == t_rr_type::CHANX || rr_type == t_rr_type::CHANY)) {
195195
auto switch_type = rr_graph.rr_switch_inf(RRSwitchId(kv.first)).type();
196196

197197
VPR_ERROR(VPR_ERROR_ROUTE, "in check_rr_graph: node %d has %d redundant connections to node %d of switch type %d (%s)",
@@ -269,7 +269,7 @@ void check_rr_graph(const RRGraphView& rr_graph,
269269
|| (rr_graph.node_ylow(rr_node) == 1)
270270
|| (rr_graph.node_xhigh(rr_node) == int(grid.width()) - 2)
271271
|| (rr_graph.node_yhigh(rr_node) == int(grid.height()) - 2));
272-
bool is_wire = (rr_graph.node_type(rr_node) == CHANX
272+
bool is_wire = (rr_graph.node_type(rr_node) == t_rr_type::CHANX
273273
|| rr_graph.node_type(rr_node) == t_rr_type::CHANY);
274274

275275
if (!is_chain && !is_fringe && !is_wire) {
@@ -425,7 +425,7 @@ void check_rr_node(const RRGraphView& rr_graph,
425425
}
426426
break;
427427

428-
case CHANX:
428+
case t_rr_type::CHANX:
429429
if (xlow < 1 || xhigh > int(grid.width()) - 2 || yhigh > int(grid.height()) - 2 || yhigh != ylow) {
430430
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
431431
"in check_rr_node: CHANX out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
@@ -488,14 +488,14 @@ void check_rr_node(const RRGraphView& rr_graph,
488488
}
489489
break;
490490

491-
case CHANX:
491+
case t_rr_type::CHANX:
492492
case t_rr_type::CHANY:
493493
if (route_type == DETAILED) {
494494
nodes_per_chan = chan_width.max;
495495
tracks_per_node = 1;
496496
} else {
497497
nodes_per_chan = 1;
498-
tracks_per_node = ((rr_type == CHANX) ? chan_width.x_list[ylow] : chan_width.y_list[xlow]);
498+
tracks_per_node = ((rr_type == t_rr_type::CHANX) ? chan_width.x_list[ylow] : chan_width.y_list[xlow]);
499499
}
500500

501501
//if a chanx/chany has length 0, it means it is used to connect different dice together
@@ -522,7 +522,7 @@ void check_rr_node(const RRGraphView& rr_graph,
522522
C = rr_graph.node_C(rr_node);
523523
R = rr_graph.node_R(rr_node);
524524

525-
if (rr_type == CHANX || rr_type == t_rr_type::CHANY) {
525+
if (rr_type == t_rr_type::CHANX || rr_type == t_rr_type::CHANY) {
526526
if (C < 0. || R < 0.) {
527527
VPR_ERROR(VPR_ERROR_ROUTE,
528528
"in check_rr_node: node %d of type %d has R = %g and C = %g.\n", inode, rr_type, R, C);
@@ -545,7 +545,7 @@ static void check_unbuffered_edges(const RRGraphView& rr_graph, int from_node) {
545545
bool trans_matched;
546546

547547
from_rr_type = rr_graph.node_type(RRNodeId(from_node));
548-
if (from_rr_type != CHANX && from_rr_type != t_rr_type::CHANY)
548+
if (from_rr_type != t_rr_type::CHANX && from_rr_type != t_rr_type::CHANY)
549549
return;
550550

551551
from_num_edges = rr_graph.num_edges(RRNodeId(from_node));
@@ -554,7 +554,7 @@ static void check_unbuffered_edges(const RRGraphView& rr_graph, int from_node) {
554554
to_node = size_t(rr_graph.edge_sink_node(RRNodeId(from_node), from_edge));
555555
to_rr_type = rr_graph.node_type(RRNodeId(to_node));
556556

557-
if (to_rr_type != CHANX && to_rr_type != t_rr_type::CHANY)
557+
if (to_rr_type != t_rr_type::CHANX && to_rr_type != t_rr_type::CHANY)
558558
continue;
559559

560560
from_switch_type = rr_graph.edge_switch(RRNodeId(from_node), from_edge);

vpr/src/route/annotate_routing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_nets(const ClusteringContex
4242
const RRNodeId rr_node = rt_node.inode;
4343
/* Ignore source and sink nodes, they are the common node multiple starting and ending points */
4444
if ((t_rr_type::SOURCE != rr_graph.node_type(rr_node))
45-
&& (SINK != rr_graph.node_type(rr_node))) {
45+
&& (t_rr_type::SINK != rr_graph.node_type(rr_node))) {
4646
/* Sanity check: ensure we do not revoke any net mapping
4747
* In some routing architectures, node capacity is more than 1
4848
* which allows a node to be mapped by multiple nets

vpr/src/route/check_route.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ static bool check_adjacent(RRNodeId from_node, RRNodeId to_node, bool is_flat) {
370370
case t_rr_type::IPIN:
371371
from_grid_type = device_ctx.grid.get_physical_type({from_xlow, from_ylow, from_layer});
372372
if (is_flat) {
373-
VTR_ASSERT(to_type == t_rr_type::OPIN || to_type == t_rr_type::IPIN || to_type == SINK);
373+
VTR_ASSERT(to_type == t_rr_type::OPIN || to_type == t_rr_type::IPIN || to_type == t_rr_type::SINK);
374374
} else {
375-
VTR_ASSERT(to_type == SINK);
375+
VTR_ASSERT(to_type == t_rr_type::SINK);
376376
}
377377

378378
//An IPIN should be contained within the bounding box of its connected sink's tile
379-
if (to_type == SINK) {
379+
if (to_type == t_rr_type::SINK) {
380380
if (from_xlow >= to_xlow
381381
&& from_ylow >= to_ylow
382382
&& from_xhigh <= to_xhigh
@@ -460,7 +460,7 @@ static bool check_adjacent(RRNodeId from_node, RRNodeId to_node, bool is_flat) {
460460
}
461461
/* UDSD Modification by WMF End */
462462
}
463-
} else if (to_type == CHANX) {
463+
} else if (to_type == t_rr_type::CHANX) {
464464
num_adj += chanx_chany_adjacent(to_node, from_node);
465465
} else {
466466
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
@@ -571,7 +571,7 @@ static void check_locally_used_clb_opins(const t_clb_opins_used& clb_opins_used_
571571
/* Now check that node is an OPIN of the right type. */
572572

573573
rr_type = rr_graph.node_type(RRNodeId(inode));
574-
if (rr_type != OPIN) {
574+
if (rr_type != t_rr_type::OPIN) {
575575
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
576576
"in check_locally_used_opins: block #%lu (%s)\n"
577577
"\tClass %d local OPIN is wrong rr_type -- rr_node #%d of type %d.\n",
@@ -883,7 +883,7 @@ bool StubFinder::RecurseTree(const RouteTreeNode& rt_node) {
883883

884884
if (rt_node.is_leaf()) {
885885
//If a leaf of the route tree is not a SINK, then it is a stub
886-
if (rr_graph.node_type(rt_node.inode) != SINK) {
886+
if (rr_graph.node_type(rt_node.inode) != t_rr_type::SINK) {
887887
return true; //It is the current root of this stub
888888
} else {
889889
return false;

vpr/src/route/overuse_report.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void report_overused_nodes(const Netlist<>& net_list,
130130
int y = rr_graph.node_ylow(node_id);
131131
int layer_num = rr_graph.node_layer(node_id);
132132
switch (node_type) {
133-
case IPIN:
133+
case t_rr_type::IPIN:
134134
case OPIN:
135135
report_overused_ipin_opin(os,
136136
node_id,

vpr/src/route/rr_graph.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ static void add_pins_rr_graph(RRGraphBuilder& rr_graph_builder,
24962496
int x_offset = x_offset_vec[pin_coord];
24972497
int y_offset = y_offset_vec[pin_coord];
24982498
e_side pin_side = pin_sides_vec[pin_coord];
2499-
auto node_type = (pin_type == DRIVER) ? t_rr_type::OPIN : IPIN;
2499+
auto node_type = (pin_type == DRIVER) ? t_rr_type::OPIN : t_rr_type::IPIN;
25002500
RRNodeId node_id = node_lookup.find_node(layer,
25012501
i + x_offset,
25022502
j + y_offset,
@@ -4210,7 +4210,7 @@ static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder,
42104210
continue;
42114211
}
42124212

4213-
RRNodeId opin_node_index = rr_graph_builder.node_lookup().find_node(layer, i, j, OPIN, pin_index, side);
4213+
RRNodeId opin_node_index = rr_graph_builder.node_lookup().find_node(layer, i, j, t_rr_type::OPIN, pin_index, side);
42144214
if (!opin_node_index) continue; //No valid from node
42154215

42164216
for (int iseg = 0; iseg < num_seg_types; iseg++) {
@@ -4623,7 +4623,7 @@ static RRNodeId pick_best_direct_connect_target_rr_node(const RRGraphView& rr_gr
46234623
//candidate would be picked (i.e. to minimize the drawn edge length).
46244624
//
46254625
//This function attempts to pick the 'best/closest' of the candidates.
4626-
VTR_ASSERT(rr_graph.node_type(from_rr) == OPIN);
4626+
VTR_ASSERT(rr_graph.node_type(from_rr) == t_rr_type::OPIN);
46274627

46284628
float best_dist = std::numeric_limits<float>::infinity();
46294629
RRNodeId best_rr = RRNodeId::INVALID();

0 commit comments

Comments
 (0)