Skip to content

Commit

Permalink
Merge pull request #2400 from verilog-to-routing/add_place_debug_info
Browse files Browse the repository at this point in the history
Add More Debugging Messages When Move Is Aborted
  • Loading branch information
vaughnbetz authored Sep 28, 2023
2 parents 37d5928 + a1bd6d7 commit 18cc251
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions vpr/src/place/centroid_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ e_create_move CentroidMoveGenerator::propose_move(t_pl_blocks_to_be_moved& block
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Centroid Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down
1 change: 1 addition & 0 deletions vpr/src/place/critical_uniform_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ e_create_move CriticalUniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved
auto& cluster_ctx = g_vpr_ctx.clustering();

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down
1 change: 1 addition & 0 deletions vpr/src/place/feasible_region_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ e_create_move FeasibleRegionMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Feasible Region Move Choose Block %di - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down
5 changes: 4 additions & 1 deletion vpr/src/place/median_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Median Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down Expand Up @@ -100,8 +101,10 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
place_move_ctx.Y_coord.push_back(coords.ymax);
}

if ((place_move_ctx.X_coord.empty()) || (place_move_ctx.Y_coord.empty()))
if ((place_move_ctx.X_coord.empty()) || (place_move_ctx.Y_coord.empty())) {
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tMove aborted - X_coord and y_coord are empty\n");
return e_create_move::ABORT;
}

//calculate the median region
std::sort(place_move_ctx.X_coord.begin(), place_move_ctx.X_coord.end());
Expand Down
4 changes: 3 additions & 1 deletion vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,8 @@ static e_move_result try_swap(const t_annealing_state* state,
}
LOG_MOVE_STATS_PROPOSED(t, blocks_affected);

VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\t\tBefore move Place cost %f, bb_cost %f, timing cost %f\n", costs->cost, costs->bb_cost, costs->timing_cost);

e_move_result move_outcome = e_move_result::ABORTED;

if (create_move_outcome == e_create_move::ABORT) {
Expand Down Expand Up @@ -1740,7 +1742,7 @@ static e_move_result try_swap(const t_annealing_state* state,
// greatly slow the placer, but can debug some issues.
check_place(*costs, delay_model, criticalities, place_algorithm, noc_opts);
#endif
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\t\tPlace cost %f, bb_cost %f, timing cost %f\n", costs->cost, costs->bb_cost, costs->timing_cost);
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\t\tAfter move Place cost %f, bb_cost %f, timing cost %f\n", costs->cost, costs->bb_cost, costs->timing_cost);
return move_outcome;
}

Expand Down
4 changes: 1 addition & 3 deletions vpr/src/place/place_constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ inline bool floorplan_legal(const t_pl_blocks_to_be_moved& blocks_affected) {
for (int i = 0; i < blocks_affected.num_moved_blocks; i++) {
floorplan_legal = cluster_floorplanning_legal(blocks_affected.moved_blocks[i].block_num, blocks_affected.moved_blocks[i].new_loc);
if (!floorplan_legal) {
# ifdef VERBOSE
VTR_LOG("Move aborted for block %zu, location tried was x: %d, y: %d, subtile: %d \n", size_t(blocks_affected.moved_blocks[i].block_num), blocks_affected.moved_blocks[i].new_loc.x, blocks_affected.moved_blocks[i].new_loc.y, blocks_affected.moved_blocks[i].new_loc.sub_tile);
# endif
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tMove aborted for block %zu, location tried was x: %d, y: %d, subtile: %d \n", size_t(blocks_affected.moved_blocks[i].block_num), blocks_affected.moved_blocks[i].new_loc.x, blocks_affected.moved_blocks[i].new_loc.y, blocks_affected.moved_blocks[i].new_loc.sub_tile);
return false;
}
}
Expand Down
1 change: 1 addition & 0 deletions vpr/src/place/uniform_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ e_create_move UniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Uniform Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down
1 change: 1 addition & 0 deletions vpr/src/place/weighted_centroid_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ e_create_move WeightedCentroidMoveGenerator::propose_move(t_pl_blocks_to_be_move
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Weighted Centroid Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down
5 changes: 4 additions & 1 deletion vpr/src/place/weighted_median_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ e_create_move WeightedMedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Weighted Median Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);

if (!b_from) { //No movable block found
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tNo movable block found\n");
return e_create_move::ABORT;
}

Expand Down Expand Up @@ -73,8 +74,10 @@ e_create_move WeightedMedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
place_move_ctx.Y_coord.insert(place_move_ctx.Y_coord.end(), ceil(coords.ymax.criticality * CRIT_MULT_FOR_W_MEDIAN), coords.ymax.edge);
}

if ((place_move_ctx.X_coord.empty()) || (place_move_ctx.Y_coord.empty()))
if ((place_move_ctx.X_coord.empty()) || (place_move_ctx.Y_coord.empty())) {
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\tMove aborted - X_coord and y_coord are empty\n");
return e_create_move::ABORT;
}

//calculate the weighted median region
std::sort(place_move_ctx.X_coord.begin(), place_move_ctx.X_coord.end());
Expand Down

0 comments on commit 18cc251

Please sign in to comment.