Skip to content

Commit b47b0ba

Browse files
draw interposer edges
1 parent a8ef54b commit b47b0ba

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

vpr/src/draw/draw_rr_edges.cpp

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,23 @@ void draw_chany_to_chany_edge(RRNodeId from_node, RRNodeId to_node, RRSwitchId r
5858
if (rr_graph.node_direction(to_node) == Direction::INC) { // INC wire starts at bottom edge
5959
if (rr_graph.node_direction(from_node) == Direction::DEC) {
6060
y2 = to_chan.bottom();
61-
y1 = draw_coords->tile_y[to_ylow] + draw_coords->get_tile_width() / 10;
61+
y1 = draw_coords->tile_y[to_ylow] + 0.1 * draw_coords->get_tile_height() ;
6262
} else {
6363
VTR_ASSERT_SAFE(rr_graph.node_direction(from_node) == Direction::INC);
6464
y2 = to_chan.bottom();
6565
// since no U-turns from_tracks must be INC as well
66-
y1 = draw_coords->tile_y[to_ylow - 1] + draw_coords->get_tile_width();
66+
y1 = draw_coords->tile_y[to_ylow - 1] + draw_coords->get_tile_height();
6767
}
68-
6968
} else { // DEC wire starts at top edge
7069
VTR_ASSERT_SAFE(rr_graph.node_direction(to_node) == Direction::DEC);
71-
72-
y2 = to_chan.top();
73-
y1 = draw_coords->tile_y[to_yhigh + 1];
70+
if (rr_graph.node_direction(from_node) == Direction::INC) {
71+
y2 = to_chan.top();
72+
y1 = draw_coords->tile_y[to_yhigh] + 0.9 * draw_coords->get_tile_height();
73+
} else {
74+
VTR_ASSERT_SAFE(rr_graph.node_direction(from_node) == Direction::DEC);
75+
y2 = to_chan.top();
76+
y1 = draw_coords->tile_y[to_yhigh + 1];
77+
}
7478
}
7579
} else {
7680
if (to_ylow < from_ylow) { // Draw from bottom edge of one to other.
@@ -117,31 +121,40 @@ void draw_chanx_to_chanx_edge(RRNodeId from_node, RRNodeId to_node, RRSwitchId r
117121
int from_xhigh = rr_graph.node_xhigh(from_node);
118122
int to_xlow = rr_graph.node_xlow(to_node);
119123
int to_xhigh = rr_graph.node_xhigh(to_node);
120-
if (to_xhigh < from_xlow) { /* From right to left */
124+
if (to_xhigh < from_xlow) { // From right to left
121125
// Could never happen for INC wires, unless U-turn. For DEC wires this handles well
122126
x1 = from_chan.left();
123127
x2 = to_chan.right();
124-
} else if (to_xlow > from_xhigh) { /* From left to right */
128+
} else if (to_xlow > from_xhigh) { // From left to right
125129
// Could never happen for DEC wires, unless U-turn. For INC wires this handles well
126130
x1 = from_chan.right();
127131
x2 = to_chan.left();
128132
}
129-
/* Segments overlap in the channel. Figure out best way to draw. Have to *
130-
* make sure the drawing is symmetric in the from rr and to rr so the edges *
131-
* will be drawn on top of each other for bidirectional connections. */
133+
// Segments overlap in the channel. Figure out the best way to draw. Have to
134+
// make sure the drawing is symmetric in the from rr and to rr so the edges
135+
// will be drawn on top of each other for bidirectional connections.
132136
else {
133137
if (rr_graph.node_direction(to_node) != Direction::BIDIR) {
134138
// must connect to to_node's wire beginning at x2
135139
if (rr_graph.node_direction(to_node) == Direction::INC) { // INC wire starts at leftmost edge
136-
VTR_ASSERT(from_xlow < to_xlow);
137-
x2 = to_chan.left();
138-
// since no U-turns from_tracks must be INC as well
139-
x1 = draw_coords->tile_x[to_xlow - 1]
140-
+ draw_coords->get_tile_width();
140+
if (rr_graph.node_direction(from_node) == Direction::DEC) {
141+
x2 = to_chan.left();
142+
x1 = draw_coords->tile_x[to_xlow] + 0.1 * draw_coords->get_tile_width();
143+
} else {
144+
VTR_ASSERT_SAFE(rr_graph.node_direction(from_node) == Direction::INC);
145+
x2 = to_chan.left();
146+
x1 = draw_coords->tile_x[to_xlow - 1] + 0.9 * draw_coords->get_tile_width();
147+
}
141148
} else { // DEC wire starts at rightmost edge
142-
VTR_ASSERT(from_xhigh > to_xhigh);
143-
x2 = to_chan.right();
144-
x1 = draw_coords->tile_x[to_xhigh + 1];
149+
VTR_ASSERT_SAFE(rr_graph.node_direction(to_node) == Direction::DEC);
150+
if (rr_graph.node_direction(from_node) == Direction::INC) {
151+
x2 = to_chan.right();
152+
x1 = draw_coords->tile_x[to_xhigh] + 0.9 * draw_coords->get_tile_width();
153+
} else {
154+
VTR_ASSERT_SAFE(rr_graph.node_direction(from_node) == Direction::DEC);
155+
x2 = to_chan.right();
156+
x1 = draw_coords->tile_x[to_xhigh + 1];
157+
}
145158
}
146159
} else {
147160
if (to_xlow < from_xlow) { // Draw from left edge of one to other

0 commit comments

Comments
 (0)