Skip to content

Commit 6d94b75

Browse files
update search_range in intersect_range_limit_with_floorplan_constraints()
1 parent 8db689a commit 6d94b75

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

vpr/src/place/move_utils.cpp

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,27 +1265,9 @@ bool intersect_range_limit_with_floorplan_constraints(t_logical_block_type_ptr t
12651265
t_bb& search_range,
12661266
int& delta_cx,
12671267
int layer_num) {
1268-
//Retrieve the compressed block grid for this block type
1269-
const auto& compressed_block_grid = g_vpr_ctx.placement().compressed_block_grids[type->index];
1270-
1271-
auto min_grid_loc = compressed_block_grid.compressed_loc_to_grid_loc({search_range.xmin,
1272-
search_range.ymin,
1273-
layer_num});
1274-
1275-
auto max_grid_loc = compressed_block_grid.compressed_loc_to_grid_loc({search_range.xmax,
1276-
search_range.ymax,
1277-
layer_num});
1278-
1279-
Region range_reg;
1280-
range_reg.set_region_rect({min_grid_loc.x,
1281-
min_grid_loc.y,
1282-
max_grid_loc.x,
1283-
max_grid_loc.y,
1284-
layer_num});
1285-
12861268
const auto& floorplanning_ctx = g_vpr_ctx.floorplanning();
12871269

1288-
const PartitionRegion& pr = floorplanning_ctx.cluster_constraints[b_from];
1270+
const PartitionRegion& pr = floorplanning_ctx.compressed_cluster_constraints[b_from];
12891271
const std::vector<Region>& regions = pr.get_regions();
12901272
Region intersect_reg;
12911273
/*
@@ -1296,22 +1278,27 @@ bool intersect_range_limit_with_floorplan_constraints(t_logical_block_type_ptr t
12961278
* complicated case to get correct functionality during place moves.
12971279
*/
12981280
if (regions.size() == 1) {
1281+
Region range_reg;
1282+
range_reg.set_region_rect({search_range.xmin, search_range.ymin,
1283+
search_range.xmax, search_range.ymax,
1284+
layer_num});
1285+
12991286
intersect_reg = intersection(regions[0], range_reg);
13001287

13011288
if (intersect_reg.empty()) {
1302-
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tCouldn't find an intersection between floorplan constraints and search region\n");
1289+
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug,
1290+
"\tCouldn't find an intersection between floorplan constraints and search region\n");
13031291
return false;
13041292
} else {
13051293
const auto intersect_coord = intersect_reg.get_region_rect();
13061294
VTR_ASSERT(intersect_coord.layer_num == layer_num);
1307-
auto min_compressed_loc = compressed_block_grid.grid_loc_to_compressed_loc_approx({intersect_coord.xmin,
1308-
intersect_coord.ymin,
1309-
layer_num});
1310-
1311-
auto max_compressed_loc = compressed_block_grid.grid_loc_to_compressed_loc_approx({intersect_coord.xmax,
1312-
intersect_coord.ymax,
1313-
layer_num});
1314-
delta_cx = max_compressed_loc.x - min_compressed_loc.x;
1295+
1296+
delta_cx = intersect_coord.xmax - intersect_coord.xmin;
1297+
search_range.xmin = intersect_coord.xmin;
1298+
search_range.ymin = intersect_coord.ymin;
1299+
search_range.xmax = intersect_coord.xmax;
1300+
search_range.ymax = intersect_coord.ymax;
1301+
search_range.layer_max = search_range.layer_min = layer_num;
13151302
}
13161303
}
13171304

0 commit comments

Comments
 (0)