Skip to content

Commit cd75e21

Browse files
early check to see if a block can be placed in a layer
1 parent e97bfff commit cd75e21

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

vpr/src/base/region.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void Region::set_sub_tile(int sub_tile) {
4545
sub_tile_ = sub_tile;
4646
}
4747

48-
bool Region::empty() {
48+
bool Region::empty() const {
4949
const vtr::Rect<int>& rect = region_bounds_.get_rect();
5050
const auto [layer_begin, layer_end] = region_bounds_.get_layer_range();
5151

vpr/src/base/region.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Region {
100100
* @brief Return whether the region is empty (i. e. the region bounds rectangle
101101
* covers no area)
102102
*/
103-
bool empty();
103+
bool empty() const;
104104

105105
/**
106106
* @brief Check if the location is in the region (at a valid x, y, subtile location within the region bounds, inclusive)

vpr/src/place/move_utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,10 @@ bool intersect_range_limit_with_floorplan_constraints(ClusterBlockId b_from,
12741274
* complicated case to get correct functionality during place moves.
12751275
*/
12761276
if (compressed_regions.size() == 1) {
1277+
if (compressed_regions[0].empty()) {
1278+
return false;
1279+
}
1280+
12771281
Region range_reg;
12781282
range_reg.set_region_bounds({search_range.xmin, search_range.ymin,
12791283
search_range.xmax, search_range.ymax,

0 commit comments

Comments
 (0)