Skip to content

Changing subtile selection in the try_centroid_placement of initial_placement #2897

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
Changes from 1 commit
Commits
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
18 changes: 17 additions & 1 deletion vpr/src/place/initial_placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,23 @@ static bool try_centroid_placement(const t_pl_macro& pl_macro,
const auto& compressed_block_grid = g_vpr_ctx.placement().compressed_block_grids[block_type->index];
const auto& type = device_ctx.grid.get_physical_type({centroid_loc.x, centroid_loc.y, centroid_loc.layer});
const auto& compatible_sub_tiles = compressed_block_grid.compatible_sub_tile_num(type->index);
centroid_loc.sub_tile = compatible_sub_tiles[rng.irand((int)compatible_sub_tiles.size() - 1)];

//filter out occupied subtiles to prevent falling to try_place_macro_randomly while we have available subtiles already.
const GridBlock& grid_blocks = blk_loc_registry.grid_blocks();
std::vector<int> available_sub_tiles;
for (int sub_tile : compatible_sub_tiles) {
t_pl_loc pos = {centroid_loc.x, centroid_loc.y, sub_tile, centroid_loc.layer};
if (!grid_blocks.block_at_location(pos)) {
available_sub_tiles.push_back(sub_tile);
}
}

//if no available subtile is found, we don't need to try_place_macro.
if (available_sub_tiles.empty()) {
return false;
}

centroid_loc.sub_tile = available_sub_tiles[rng.irand((int)available_sub_tiles.size() - 1)];
}
int width_offset = device_ctx.grid.get_width_offset({centroid_loc.x, centroid_loc.y, centroid_loc.layer});
int height_offset = device_ctx.grid.get_height_offset({centroid_loc.x, centroid_loc.y, centroid_loc.layer});
Expand Down
Loading