Skip to content

Commit e98abf9

Browse files
[3D] Cleaned Up Checking for Open Positions
1 parent 0266d78 commit e98abf9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

vpr/src/place/initial_placement.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ static bool find_centroid_neighbor(ClusterBlockId block_id,
415415
const auto& compressed_block_grid = g_vpr_ctx.placement().compressed_block_grids[block_type->index];
416416
const int num_layers = g_vpr_ctx.device().grid.get_num_layers();
417417
const int centroid_loc_layer_num = centroid_loc.layer;
418+
VTR_ASSERT(centroid_loc_layer_num != OPEN);
418419

419420
//Determine centroid location in the compressed space of the current block
420421
auto compressed_centroid_loc = get_compressed_loc_approx(compressed_block_grid,
@@ -424,8 +425,12 @@ static bool find_centroid_neighbor(ClusterBlockId block_id,
424425
// If no compressed location can be found on this layer, return false.
425426
// TODO: Maybe search in the layers above or below.
426427
const t_physical_tile_loc& compressed_loc_on_layer = compressed_centroid_loc[centroid_loc.layer];
427-
if (compressed_loc_on_layer.x == OPEN && compressed_loc_on_layer.y == OPEN && compressed_loc_on_layer.layer_num == OPEN)
428+
if (compressed_loc_on_layer.x == OPEN || compressed_loc_on_layer.y == OPEN) {
429+
VTR_ASSERT_MSG(compressed_loc_on_layer.x == OPEN && compressed_loc_on_layer.y == OPEN,
430+
"When searching for a compressed location, and a location cannot be found "
431+
"both x and y should be OPEN.");
428432
return false;
433+
}
429434

430435
//range limit (rlim) set a limit for the neighbor search in the centroid placement
431436
//the neighbor location should be within the defined range to calculated centroid location

vpr/src/place/move_utils.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,12 @@ bool find_to_loc_centroid(t_logical_block_type_ptr blk_type,
855855
// If no compressed location can be found on this layer, return false.
856856
// TODO: Maybe search in the layers above or below.
857857
const t_physical_tile_loc& compressed_loc_on_layer = centroid_compressed_loc[to_layer_num];
858-
if (compressed_loc_on_layer.x == OPEN && compressed_loc_on_layer.y == OPEN && compressed_loc_on_layer.layer_num == OPEN)
858+
if (compressed_loc_on_layer.x == OPEN || compressed_loc_on_layer.y == OPEN) {
859+
VTR_ASSERT_MSG(compressed_loc_on_layer.x == OPEN && compressed_loc_on_layer.y == OPEN,
860+
"When searching for a compressed location, and a location cannot be found "
861+
"both x and y should be OPEN.");
859862
return false;
863+
}
860864

861865
//Determine the valid compressed grid location ranges
862866
int delta_cx;

0 commit comments

Comments
 (0)