Skip to content

Commit 8c0fdfc

Browse files
add get_move_abortion_logger() to PlacementAnnealer
1 parent 834e589 commit 8c0fdfc

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

vpr/src/place/annealer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,10 @@ std::tuple<const t_swap_stats&, const MoveTypeStat&, const t_placer_statistics&>
791791
return {swap_stats_, move_type_stats_, placer_stats_};
792792
}
793793

794+
const MoveAbortionLogger& PlacementAnnealer::get_move_abortion_logger() const {
795+
return blocks_affected_.move_abortion_logger;
796+
}
797+
794798
void PlacementAnnealer::LOG_MOVE_STATS_HEADER() {
795799
if constexpr (VTR_ENABLE_DEBUG_LOGGING_CONST_EXPR) {
796800
if (move_stats_file_) {
@@ -870,4 +874,4 @@ e_move_result PlacementAnnealer::assess_swap_(double delta_c, double t) {
870874
}
871875
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\t\tMove is rejected(hill climbing)\n");
872876
return e_move_result::REJECTED;
873-
}
877+
}

vpr/src/place/annealer.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ class PlacementAnnealer {
222222
/// @brief Returns constant references to different statistics objects
223223
std::tuple<const t_swap_stats&, const MoveTypeStat&, const t_placer_statistics&> get_stats() const;
224224

225+
/**
226+
* @brief Returns MoveAbortionLogger to report how many moves
227+
* were aborted for each reason.
228+
* @return A constant reference to a MoveAbortionLogger object.
229+
*/
230+
const MoveAbortionLogger& get_move_abortion_logger() const;
231+
225232
private:
226233

227234
/**

vpr/src/place/place.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ void try_place(const Netlist<>& net_list,
169169
std::unique_ptr<PlacerCriticalities> placer_criticalities;
170170
std::unique_ptr<NetPinTimingInvalidator> pin_timing_invalidator;
171171

172-
t_pl_blocks_to_be_moved blocks_affected(net_list.blocks().size());
173-
174172
if (placer_opts.place_algorithm.is_timing_driven()) {
175173
/*do this before the initial placement to avoid messing up the initial placement */
176174
place_delay_model = alloc_lookups_and_delay_model(net_list,
@@ -552,7 +550,7 @@ void try_place(const Netlist<>& net_list,
552550
//Some stats
553551
VTR_LOG("\n");
554552
VTR_LOG("Swaps called: %d\n", swap_stats.num_ts_called);
555-
blocks_affected.move_abortion_logger.report_aborted_moves();
553+
annealer.get_move_abortion_logger().report_aborted_moves();
556554

557555
if (placer_opts.place_algorithm.is_timing_driven()) {
558556
//Final timing estimate

0 commit comments

Comments
 (0)