Skip to content

Commit dc03ec7

Browse files
Fix off by one error in drawing
1 parent 896108b commit dc03ec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vpr/src/draw/draw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,14 @@ void init_draw_coords(float clb_width, const BlkLocRegistry& blk_loc_registry) {
535535
size_t j = 0;
536536
for (size_t i = 0; i < grid.width() - 1; i++) {
537537
draw_coords->tile_x[i] = i * draw_coords->get_tile_width() + j;
538-
j += max_chany_ptc_nums[i] + 1; // N wires need N+1 units of space
538+
j += max_chany_ptc_nums[i] + 2; // N wires need N + 1 units of space, plus one more since max ptc_num of 0 means 1 wire in the channel
539539
}
540540
draw_coords->tile_x[grid.width() - 1] = (grid.width() - 1) * draw_coords->get_tile_width() + j;
541541

542542
j = 0;
543543
for (size_t i = 0; i < grid.height() - 1; ++i) {
544544
draw_coords->tile_y[i] = i * draw_coords->get_tile_width() + j;
545-
j += max_chanx_ptc_nums[i] + 1;
545+
j += max_chanx_ptc_nums[i] + 2;
546546
}
547547
draw_coords->tile_y[grid.height() - 1] = (grid.height() - 1) * draw_coords->get_tile_width() + j;
548548

0 commit comments

Comments
 (0)