Skip to content

Commit 6be051e

Browse files
committed
Inverse use of macro_can_be_placed argument check_all_legality to align with meaning
1 parent 1e479b9 commit 6be051e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

vpr/src/place/analytic_placer.cpp

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,10 @@ static inline t_pl_loc find_nearest_compatible_loc(const t_flat_pl_loc& src_flat
742742
// floorplanning constraints and compatibility for all
743743
// members of the macro. This prevents some macros being
744744
// placed where they obviously cannot be implemented.
745-
// Note: The check_all_legality flag is poorly named. false means
746-
// that it WILL check all legality...
747745
t_pl_loc new_loc = t_pl_loc(grid_loc.x, grid_loc.y, new_sub_tile, grid_loc.layer_num);
748746
bool site_legal_for_macro = macro_can_be_placed(pl_macro,
749747
new_loc,
750-
false /*check_all_legality*/,
748+
true /*check_all_legality*/,
751749
blk_loc_registry);
752750
if (site_legal_for_macro) {
753751
// Update the best solition.
@@ -1210,9 +1208,10 @@ bool try_place_macro(const t_pl_macro& pl_macro,
12101208
return macro_placed;
12111209
}
12121210

1213-
bool mac_can_be_placed = macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/false, blk_loc_registry);
1211+
// called from initial placement
1212+
bool macro_can_be_placed = macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/true, blk_loc_registry);
12141213

1215-
if (mac_can_be_placed) {
1214+
if (macro_can_be_placed) {
12161215
// Place down the macro
12171216
macro_placed = true;
12181217
VTR_LOGV_DEBUG(f_placer_debug, "\t\t\t\tMacro is placed at the given location\n");

vpr/src/place/place_util.cpp

Lines changed: 1 addition & 1 deletion
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)