Skip to content

Commit fc9c6a5

Browse files
committed
[vpr][place] update initial placement to limit set search range based on placement constraints
1 parent c45e572 commit fc9c6a5

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

vpr/src/place/initial_placement.cpp

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,19 @@ static bool find_centroid_neighbor(ClusterBlockId block_id,
426426
auto search_range = get_compressed_grid_target_search_range(compressed_block_grid,
427427
compressed_centroid_loc[centroid_loc_layer_num],
428428
first_rlim);
429-
429+
430430
int delta_cx = search_range.xmax - search_range.xmin;
431-
432-
bool search_range_adjusted = adjust_search_range(block_type,
433-
block_id,
434-
search_range,
435-
delta_cx,
436-
centroid_loc_layer_num);
437-
438-
if (!search_range_adjusted) {
439-
return false;
431+
432+
auto block_constrained = is_cluster_constrained(block_id);
433+
434+
if (block_constrained) {
435+
bool intersect = intersect_range_limit_with_floorplan_constraints(block_id,
436+
search_range,
437+
delta_cx,
438+
centroid_loc_layer_num);
439+
if (!intersect) {
440+
return false;
441+
}
440442
}
441443

442444
//Block has not been placed yet, so the "from" coords will be (-1, -1)
@@ -455,7 +457,8 @@ static bool find_centroid_neighbor(ClusterBlockId block_id,
455457
centroid_loc_layer_num,
456458
search_for_empty,
457459
blk_loc_registry,
458-
rng);
460+
rng,
461+
block_constrained);
459462

460463
if (!legal) {
461464
return false;
@@ -1080,6 +1083,9 @@ bool try_place_macro_randomly(const t_pl_macro& pl_macro,
10801083

10811084
bool legal;
10821085

1086+
// is_fixed_range is true since even if the block is not constrained,
1087+
// the search range covers the entire region, so there is no need for
1088+
// the search range to be adjusted
10831089
legal = find_compatible_compressed_loc_in_range(block_type,
10841090
delta_cx,
10851091
{cx_from, cy_from, selected_layer},
@@ -1091,7 +1097,8 @@ bool try_place_macro_randomly(const t_pl_macro& pl_macro,
10911097
selected_layer,
10921098
/*search_for_empty=*/false,
10931099
blk_loc_registry,
1094-
rng);
1100+
rng,
1101+
true);
10951102

10961103
if (!legal) {
10971104
//No valid position found

0 commit comments

Comments
 (0)