Skip to content

Commit 0ee28c8

Browse files
draw interposer cut lines exactly in the middle of channel/between the last wire and next tile during placement/routing
1 parent 8979661 commit 0ee28c8

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

vpr/src/draw/draw_interposer.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ void draw_interposer_cuts(ezgl::renderer* g) {
3131
g->set_line_dash(ezgl::line_dash::asymmetric_5_3);
3232
g->set_line_width(2);
3333

34-
// Offset factor used to slightly shift the interposer cut lines away from tile boundaries.
35-
// During placement, we draw the line in the middle of a routing channel.
36-
// During routing, we draw the line closer to the tile that does not own the channel.
37-
const float offset_factor = draw_state->pic_on_screen == e_pic_type::PLACEMENT ? -0.5f : -0.5f / device_ctx.chan_width.max;
38-
3934
const std::vector<std::vector<int>>& horizontal_cuts = grid.get_horizontal_interposer_cuts();
4035
const std::vector<std::vector<int>>& vertical_cuts = grid.get_vertical_interposer_cuts();
4136
std::vector<std::pair<ezgl::point2d, ezgl::point2d>> lines_to_draw;
@@ -46,12 +41,28 @@ void draw_interposer_cuts(ezgl::renderer* g) {
4641
}
4742

4843
for (int cut_y : horizontal_cuts[layer]) {
49-
float y = draw_coords->tile_y[cut_y + 1] + offset_factor * draw_coords->get_tile_height();
44+
float y;
45+
if (draw_state->pic_on_screen == e_pic_type::PLACEMENT) {
46+
y = (draw_coords->tile_y[cut_y + 1] + draw_coords->tile_y[cut_y]) / 2.0f;
47+
} else if (draw_state->pic_on_screen == e_pic_type::ROUTING) {
48+
y = draw_coords->tile_y[cut_y + 1] - 0.5f;
49+
} else {
50+
VTR_ASSERT(false);
51+
}
52+
5053
lines_to_draw.push_back({{world.left(), y}, {world.right(), y}});
5154
}
5255

5356
for (int cut_x : vertical_cuts[layer]) {
54-
float x = draw_coords->tile_x[cut_x + 1] + offset_factor * draw_coords->get_tile_width();
57+
float x;
58+
if (draw_state->pic_on_screen == e_pic_type::PLACEMENT) {
59+
x = (draw_coords->tile_x[cut_x + 1] + draw_coords->tile_x[cut_x]) / 2.0f;
60+
} else if (draw_state->pic_on_screen == e_pic_type::ROUTING) {
61+
x = draw_coords->tile_x[cut_x + 1] - 0.5f;
62+
} else {
63+
VTR_ASSERT(false);
64+
}
65+
5566
lines_to_draw.push_back({{x, world.bottom()}, {x, world.top()}});
5667
}
5768
}

0 commit comments

Comments
 (0)