Skip to content

Commit 994d7de

Browse files
authored
Merge pull request #2998 from verilog-to-routing/fredt_check_all_legality_flip
Invert use of macro_can_be_placed argument in check_all_legality
2 parents 00811b8 + f41ebb1 commit 994d7de

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
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

+2-7
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,10 @@ static inline t_pl_loc find_nearest_compatible_loc(const t_flat_pl_loc& src_flat
780780
// floorplanning constraints and compatibility for all
781781
// members of the macro. This prevents some macros being
782782
// placed where they obviously cannot be implemented.
783-
// Note: The check_all_legality flag is poorly named. false means
784-
// that it WILL check all legality...
785783
t_pl_loc new_loc = t_pl_loc(grid_loc.x, grid_loc.y, new_sub_tile, grid_loc.layer_num);
786784
bool site_legal_for_macro = macro_can_be_placed(pl_macro,
787785
new_loc,
788-
false /*check_all_legality*/,
786+
true /*check_all_legality*/,
789787
blk_loc_registry);
790788
if (site_legal_for_macro) {
791789
// Update the best solition.
@@ -1248,10 +1246,7 @@ bool try_place_macro(const t_pl_macro& pl_macro,
12481246
return macro_placed;
12491247
}
12501248

1251-
bool mac_can_be_placed = macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/false, blk_loc_registry);
1252-
1253-
if (mac_can_be_placed) {
1254-
// Place down the macro
1249+
if (macro_can_be_placed(pl_macro, head_pos, /*check_all_legality=*/true, blk_loc_registry)) {
12551250
macro_placed = true;
12561251
VTR_LOGV_DEBUG(f_placer_debug, "\t\t\t\tMacro is placed at the given location\n");
12571252
for (const t_pl_macro_member& pl_macro_member : pl_macro.members) {

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 (!check_all_legality) {
195195
continue;
196196
}
197197

vpr/src/place/place_util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ inline bool is_loc_on_chip(t_physical_tile_loc loc) {
261261
* determines whether the routine should check all legality constraint
262262
* Analytic placer does not require to check block's capacity or
263263
* floorplanning constraints. However, initial placement or SA-based approach
264-
* require to check for all legality constraints.
264+
* require checking all legality constraints.
265265
* @param blk_loc_registry Placement block location information.
266266
*
267267
*/

0 commit comments

Comments
 (0)