Skip to content

Commit 51e32ce

Browse files
committed
Removed asumptions for chan dir in graphics
1 parent 8d457c0 commit 51e32ce

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

vpr/src/draw/draw_rr_edges.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void draw_chany_to_chany_edge(RRNodeId from_node, RRNodeId to_node, int to_track
100100
/* UDSD Modification by WMF Begin */
101101
else {
102102
if (rr_graph.node_direction(to_node) != Direction::BIDIR) {
103-
if (to_track % 2 == 0) { /* INC wire starts at bottom edge */
103+
if (rr_graph.node_direction(to_node) == Direction::INC) { /* INC wire starts at bottom edge */
104104

105105
y2 = to_chan.bottom();
106106
/* since no U-turns from_track must be INC as well */
@@ -191,7 +191,7 @@ void draw_chanx_to_chanx_edge(RRNodeId from_node, RRNodeId to_node, int to_track
191191
else {
192192
if (rr_graph.node_direction(to_node) != Direction::BIDIR) {
193193
/* must connect to to_node's wire beginning at x2 */
194-
if (to_track % 2 == 0) { /* INC wire starts at leftmost edge */
194+
if (rr_graph.node_direction(to_node) == Direction::INC) { /* INC wire starts at leftmost edge */
195195
VTR_ASSERT(from_xlow < to_xlow);
196196
x2 = to_chan.left();
197197
/* since no U-turns from_track must be INC as well */
@@ -270,12 +270,11 @@ void draw_chanx_to_chany_edge(int chanx_node, int chanx_track, int chany_node, i
270270
x1 = draw_coords->tile_x[chany_x] + draw_coords->get_tile_width();
271271
if (rr_graph.node_direction(RRNodeId(chanx_node)) != Direction::BIDIR && (SwitchType)switch_type != SwitchType::SHORT) {
272272
if (edge_dir == FROM_X_TO_Y) {
273-
if ((chanx_track % 2) == 1) { /* If dec wire, then going left */
273+
if (rr_graph.node_direction(RRNodeId(chanx_node)) == Direction::DEC) { /* If dec wire, then going left */
274274
x1 = draw_coords->tile_x[chany_x + 1];
275275
}
276276
}
277277
}
278-
279278
} else { /* Must draw connection going left. */
280279
x1 = chanx_bbox.left();
281280
}
@@ -285,7 +284,7 @@ void draw_chanx_to_chany_edge(int chanx_node, int chanx_track, int chany_node, i
285284

286285
if (rr_graph.node_direction(RRNodeId(chany_node)) != Direction::BIDIR && (SwitchType)switch_type != SwitchType::SHORT) {
287286
if (edge_dir == FROM_Y_TO_X) {
288-
if ((chany_track % 2) == 1) { /* If dec wire, then going down */
287+
if (rr_graph.node_direction(RRNodeId(chany_node)) == Direction::DEC) { /* If dec wire, then going down */
289288
y2 = draw_coords->tile_y[chanx_y + 1];
290289
}
291290
}

0 commit comments

Comments
 (0)