Skip to content

Commit 66ef6c6

Browse files
committed
vpr: place: set valid value of old layer if if it is not valid
1 parent 26d24d4 commit 66ef6c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vpr/src/place/median_move_generator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
9393
xold = place_ctx.block_locs[bnum].loc.x + physical_tile_type(bnum)->pin_width_offset[pnum];
9494
yold = place_ctx.block_locs[bnum].loc.y + physical_tile_type(bnum)->pin_height_offset[pnum];
9595
layer_old = place_ctx.block_locs[bnum].loc.layer;
96+
9697
xold = std::max(std::min(xold, (int)device_ctx.grid.width() - 2), 1); //-2 for no perim channels
9798
yold = std::max(std::min(yold, (int)device_ctx.grid.height() - 2), 1); //-2 for no perim channels
98-
VTR_ASSERT(layer_old >= 0);
99-
VTR_ASSERT(layer_old < device_ctx.grid.get_num_layers());
99+
layer_old = std::max(std::min(layer_old, (int)device_ctx.grid.get_num_layers() - 1), 0);
100100

101101
//To calulate the bb incrementally while excluding the moving block
102102
//assume that the moving block is moved to a non-critical coord of the bb

0 commit comments

Comments
 (0)