Skip to content

Commit bdc8c45

Browse files
committed
Inverse use of macro_can_be_placed argument check_all_legality to align with meaning
1 parent 1dff246 commit bdc8c45

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

vpr/src/place/analytic_placer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void AnalyticPlacer::setup_solve_blks(t_logical_block_type_ptr blkTypes) {
411411
void AnalyticPlacer::update_macros() {
412412
for (auto& macro : place_macros_.macros()) {
413413
ClusterBlockId head_id = macro.members[0].blk_index;
414-
bool mac_can_be_placed = macro_can_be_placed(macro, blk_locs[head_id].loc, true, blk_loc_registry_ref_);
414+
bool mac_can_be_placed = macro_can_be_placed(macro, blk_locs[head_id].loc, false, blk_loc_registry_ref_);
415415

416416
//if macro can not be placed in this head pos, change the head pos
417417
if (!mac_can_be_placed) {
@@ -420,7 +420,7 @@ void AnalyticPlacer::update_macros() {
420420
}
421421

422422
//macro should be placed successfully after changing the head position
423-
VTR_ASSERT(macro_can_be_placed(macro, blk_locs[head_id].loc, true, blk_loc_registry_ref_));
423+
VTR_ASSERT(macro_can_be_placed(macro, blk_locs[head_id].loc, false, blk_loc_registry_ref_));
424424

425425
//update other member's location based on head pos
426426
for (auto member = ++macro.members.begin(); member != macro.members.end(); ++member) {

vpr/src/place/initial_placement.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,10 @@ static inline t_pl_loc find_nearest_compatible_loc(const t_flat_pl_loc& src_flat
733733
// floorplanning constraints and compatibility for all
734734
// members of the macro. This prevents some macros being
735735
// placed where they obviously cannot be implemented.
736-
// Note: The check_all_legality flag is poorly named. false means
737-
// that it WILL check all legality...
738736
t_pl_loc new_loc = t_pl_loc(grid_loc.x, grid_loc.y, new_sub_tile, grid_loc.layer_num);
739737
bool site_legal_for_macro = macro_can_be_placed(pl_macro,
740738
new_loc,
741-
false /*check_all_legality*/,
739+
true /*check_all_legality*/,
742740
blk_loc_registry);
743741
if (site_legal_for_macro) {
744742
// Update the best solition.
@@ -1200,9 +1198,10 @@ bool try_place_macro(const t_pl_macro& pl_macro,
12001198
return macro_placed;
12011199
}
12021200

1203-
bool mac_can_be_placed = macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/false, blk_loc_registry);
1201+
// called from initial placement
1202+
bool macro_can_be_placed = macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/true, blk_loc_registry);
12041203

1205-
if (mac_can_be_placed) {
1204+
if (macro_can_be_placed) {
12061205
// Place down the macro
12071206
macro_placed = true;
12081207
VTR_LOGV_DEBUG(f_placer_debug, "\t\t\t\tMacro is placed at the given location\n");

vpr/src/place/place_util.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ bool macro_can_be_placed(const t_pl_macro& pl_macro,
191191
* floorplan constraint is not supported by analytical placement yet,
192192
* hence, if macro_can_be_placed is called from analytical placer, no further actions are required.
193193
*/
194-
if (check_all_legality) {
194+
if (not check_all_legality) {
195195
continue;
196196
}
197197

0 commit comments

Comments
 (0)