@@ -426,17 +426,19 @@ static bool find_centroid_neighbor(ClusterBlockId block_id,
426
426
auto search_range = get_compressed_grid_target_search_range (compressed_block_grid,
427
427
compressed_centroid_loc[centroid_loc_layer_num],
428
428
first_rlim);
429
-
429
+
430
430
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
+ }
440
442
}
441
443
442
444
// 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,
455
457
centroid_loc_layer_num,
456
458
search_for_empty,
457
459
blk_loc_registry,
458
- rng);
460
+ rng,
461
+ block_constrained);
459
462
460
463
if (!legal) {
461
464
return false ;
@@ -1080,6 +1083,9 @@ bool try_place_macro_randomly(const t_pl_macro& pl_macro,
1080
1083
1081
1084
bool legal;
1082
1085
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
1083
1089
legal = find_compatible_compressed_loc_in_range (block_type,
1084
1090
delta_cx,
1085
1091
{cx_from, cy_from, selected_layer},
@@ -1091,7 +1097,8 @@ bool try_place_macro_randomly(const t_pl_macro& pl_macro,
1091
1097
selected_layer,
1092
1098
/* search_for_empty=*/ false ,
1093
1099
blk_loc_registry,
1094
- rng);
1100
+ rng,
1101
+ true );
1095
1102
1096
1103
if (!legal) {
1097
1104
// No valid position found
0 commit comments