Skip to content

Mark fixed blocks #1759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cd289a2
Added code for marking down blocks that constrained to one location o…
sfkhalid Jun 2, 2021
8ad3c1b
Region empty function now returns true if the rectangle either has im…
sfkhalid Jun 2, 2021
77786c8
Ran make format
sfkhalid Jun 2, 2021
25a5b7f
Changed default empty region values
sfkhalid Jun 9, 2021
6c6772d
Added helper function for marking block locations and grid usage with…
sfkhalid Jun 9, 2021
bf766f0
Changed placement consistency error messages to improve clarity
sfkhalid Jun 9, 2021
c915129
Add function to count number of tiles covered by a floorplan region
sfkhalid Jun 10, 2021
2f0dbf6
Changed comment
sfkhalid Jun 14, 2021
8165a5d
Changed name of function mark_block_location->set_block_location
sfkhalid Jun 15, 2021
8a90016
Added functions to check whether the PartitionRegion of a cluster blo…
sfkhalid Jun 16, 2021
2cc056b
Ran make format
sfkhalid Jun 16, 2021
904db47
Removed locked member function from Region class - was no longer need…
sfkhalid Jun 16, 2021
4f94cbd
Merge branch 'master' into mark_fixed_blocks
sfkhalid Jun 16, 2021
3a9096b
Got rid of unnecessary lines in mark_fixed_blocks
sfkhalid Jun 16, 2021
e359b20
merge branch 'mark_fixed_blocks' of https://github.com/verilog-to-rou…
sfkhalid Jun 16, 2021
3c9c93a
Ran make format
sfkhalid Jun 16, 2021
e1fa745
Initialized grid blocks earlier in flow of reading in place file
sfkhalid Jun 17, 2021
f2305df
Refactored read_place to make use of set_block_location utility function
sfkhalid Jun 17, 2021
7e0fe58
Improved error messaging during read place
sfkhalid Jun 17, 2021
0504d8c
Refactored region size routine to return an int instead of a bool
sfkhalid Jun 17, 2021
8c3c163
Refactored region tile cover routine to return int instead of bool
sfkhalid Jun 18, 2021
c3ad3b6
Modified is_pr_size_one to get rid of compiler warning
sfkhalid Jun 18, 2021
6ad75c3
Added check to partition region size check to see whether multiple re…
sfkhalid Jun 18, 2021
8887b6c
Added checks for whether subtile location is valid when marking fixed…
sfkhalid Jun 21, 2021
cbe935d
Merge branch 'master' into mark_fixed_blocks
sfkhalid Jun 21, 2021
58e2683
Check whether subtile is compatible when adding fixed blocks
sfkhalid Jun 21, 2021
57ae843
Moved initialization of placement structures during load place flow. …
sfkhalid Jun 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vpr/src/base/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool Region::locked() {
}

bool Region::empty() {
return region_bounds.empty();
return region_bounds.xmax() < region_bounds.xmin() || region_bounds.ymax() < region_bounds.ymin() || (region_bounds.xmin() == -1 && region_bounds.ymin() == -1 && region_bounds.xmax() == -1 && region_bounds.ymax() == -1);
}

bool Region::is_loc_in_reg(t_pl_loc loc) {
Expand Down
3 changes: 2 additions & 1 deletion vpr/src/base/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class Region {
void set_sub_tile(int _sub_tile);

/**
* @brief Return whether the region is empty, based on whether the region rectangle is empty
* @brief Return whether the region is empty, meaning the rectangle has impossible dimensions
* or has the default values (-1, -1, -1, -1), indicating that it is uninitialized.
*/
bool empty();

Expand Down
3 changes: 3 additions & 0 deletions vpr/src/place/initial_placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ void initial_placement(enum e_pad_loc_type pad_loc_type, const char* constraints
read_constraints(constraints_file);
}

/*Mark fixed blocks*/
mark_fixed_blocks();

initial_placement_pl_macros(MAX_NUM_TRIES_TO_PLACE_MACROS_RANDOMLY, free_locations);

// All the macros are placed, update the legal_pos[][] array and free_locations[] array
Expand Down
33 changes: 33 additions & 0 deletions vpr/src/place/place_constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,36 @@ void load_cluster_constraints() {
}
}
}

void mark_fixed_blocks() {
auto& cluster_ctx = g_vpr_ctx.clustering();
auto& place_ctx = g_vpr_ctx.mutable_placement();
auto& floorplanning_ctx = g_vpr_ctx.floorplanning();

for (auto blk_id : cluster_ctx.clb_nlist.blocks()) {
PartitionRegion pr = floorplanning_ctx.cluster_constraints[blk_id];
std::vector<Region> part_region = pr.get_partition_region();
if (part_region.size() == 1) {
int subtile = part_region[0].get_sub_tile();
vtr::Rect<int> rect = part_region[0].get_region_rect();

if (part_region[0].locked()) {
//Set the location of the block
place_ctx.block_locs[blk_id].loc.x = rect.xmin();
place_ctx.block_locs[blk_id].loc.y = rect.ymin();
place_ctx.block_locs[blk_id].loc.sub_tile = subtile;

//Mark the grid location of the block
place_ctx.grid_blocks[rect.xmin()][rect.ymin()].blocks[subtile] = blk_id;

//Set as fixed
place_ctx.block_locs[blk_id].is_fixed = true;

//Mark grid location usage
place_ctx.grid_blocks[rect.xmin()][rect.ymin()].usage++;

std::string block_name = cluster_ctx.clb_nlist.block_name(blk_id);
}
}
}
}
6 changes: 6 additions & 0 deletions vpr/src/place/place_constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,10 @@ inline bool floorplan_legal(const t_pl_blocks_to_be_moved& blocks_affected) {
*/
void load_cluster_constraints();

/*
* Marks blocks with a region with xlow = xhigh, ylow = yhigh, and subtile specified as fixed
* Marking them as fixed indicates that they cannot be moved during simulated annealing
*/
void mark_fixed_blocks();

#endif /* VPR_SRC_PLACE_PLACE_CONSTRAINTS_H_ */