Skip to content

Commit

Permalink
add get_move_abortion_logger() to PlacementAnnealer
Browse files Browse the repository at this point in the history
  • Loading branch information
soheilshahrouz committed Nov 18, 2024
1 parent 834e589 commit 8c0fdfc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion vpr/src/place/annealer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ std::tuple<const t_swap_stats&, const MoveTypeStat&, const t_placer_statistics&>
return {swap_stats_, move_type_stats_, placer_stats_};
}

const MoveAbortionLogger& PlacementAnnealer::get_move_abortion_logger() const {
return blocks_affected_.move_abortion_logger;
}

void PlacementAnnealer::LOG_MOVE_STATS_HEADER() {
if constexpr (VTR_ENABLE_DEBUG_LOGGING_CONST_EXPR) {
if (move_stats_file_) {
Expand Down Expand Up @@ -870,4 +874,4 @@ e_move_result PlacementAnnealer::assess_swap_(double delta_c, double t) {
}
VTR_LOGV_DEBUG(g_vpr_ctx.placement().f_placer_debug, "\t\tMove is rejected(hill climbing)\n");
return e_move_result::REJECTED;
}
}
7 changes: 7 additions & 0 deletions vpr/src/place/annealer.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ class PlacementAnnealer {
/// @brief Returns constant references to different statistics objects
std::tuple<const t_swap_stats&, const MoveTypeStat&, const t_placer_statistics&> get_stats() const;

/**
* @brief Returns MoveAbortionLogger to report how many moves
* were aborted for each reason.
* @return A constant reference to a MoveAbortionLogger object.
*/
const MoveAbortionLogger& get_move_abortion_logger() const;

private:

/**
Expand Down
4 changes: 1 addition & 3 deletions vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ void try_place(const Netlist<>& net_list,
std::unique_ptr<PlacerCriticalities> placer_criticalities;
std::unique_ptr<NetPinTimingInvalidator> pin_timing_invalidator;

t_pl_blocks_to_be_moved blocks_affected(net_list.blocks().size());

if (placer_opts.place_algorithm.is_timing_driven()) {
/*do this before the initial placement to avoid messing up the initial placement */
place_delay_model = alloc_lookups_and_delay_model(net_list,
Expand Down Expand Up @@ -552,7 +550,7 @@ void try_place(const Netlist<>& net_list,
//Some stats
VTR_LOG("\n");
VTR_LOG("Swaps called: %d\n", swap_stats.num_ts_called);
blocks_affected.move_abortion_logger.report_aborted_moves();
annealer.get_move_abortion_logger().report_aborted_moves();

if (placer_opts.place_algorithm.is_timing_driven()) {
//Final timing estimate
Expand Down

0 comments on commit 8c0fdfc

Please sign in to comment.