Skip to content

Commit 18cc251

Browse files
authored
Merge pull request #2400 from verilog-to-routing/add_place_debug_info
Add More Debugging Messages When Move Is Aborted
2 parents 37d5928 + a1bd6d7 commit 18cc251

9 files changed

+17
-6
lines changed

vpr/src/place/centroid_move_generator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ e_create_move CentroidMoveGenerator::propose_move(t_pl_blocks_to_be_moved& block
1515
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Centroid Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);
1616

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

vpr/src/place/critical_uniform_move_generator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ e_create_move CriticalUniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved
1818
auto& cluster_ctx = g_vpr_ctx.clustering();
1919

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

vpr/src/place/feasible_region_move_generator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ e_create_move FeasibleRegionMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
1717
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Feasible Region Move Choose Block %di - rlim %f\n", size_t(b_from), rlim);
1818

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

vpr/src/place/median_move_generator.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
1919
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Median Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);
2020

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

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

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

106109
//calculate the median region
107110
std::sort(place_move_ctx.X_coord.begin(), place_move_ctx.X_coord.end());

vpr/src/place/place.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,8 @@ static e_move_result try_swap(const t_annealing_state* state,
14971497
}
14981498
LOG_MOVE_STATS_PROPOSED(t, blocks_affected);
14991499

1500+
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);
1501+
15001502
e_move_result move_outcome = e_move_result::ABORTED;
15011503

15021504
if (create_move_outcome == e_create_move::ABORT) {
@@ -1740,7 +1742,7 @@ static e_move_result try_swap(const t_annealing_state* state,
17401742
// greatly slow the placer, but can debug some issues.
17411743
check_place(*costs, delay_model, criticalities, place_algorithm, noc_opts);
17421744
#endif
1743-
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);
1745+
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);
17441746
return move_outcome;
17451747
}
17461748

vpr/src/place/place_constraints.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ inline bool floorplan_legal(const t_pl_blocks_to_be_moved& blocks_affected) {
7171
for (int i = 0; i < blocks_affected.num_moved_blocks; i++) {
7272
floorplan_legal = cluster_floorplanning_legal(blocks_affected.moved_blocks[i].block_num, blocks_affected.moved_blocks[i].new_loc);
7373
if (!floorplan_legal) {
74-
# ifdef VERBOSE
75-
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);
76-
# endif
74+
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);
7775
return false;
7876
}
7977
}

vpr/src/place/uniform_move_generator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ e_create_move UniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks
1313
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Uniform Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);
1414

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

vpr/src/place/weighted_centroid_move_generator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ e_create_move WeightedCentroidMoveGenerator::propose_move(t_pl_blocks_to_be_move
1414
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Weighted Centroid Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);
1515

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

vpr/src/place/weighted_median_move_generator.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ e_create_move WeightedMedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
1919
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "Weighted Median Move Choose Block %d - rlim %f\n", size_t(b_from), rlim);
2020

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

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

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

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

0 commit comments

Comments
 (0)