From 1dcd63ba95e33d0c693d7df970f3dce133858fd8 Mon Sep 17 00:00:00 2001 From: soheilshahrouz Date: Wed, 27 Nov 2024 18:09:17 -0500 Subject: [PATCH] start measuring the placement time from the moment the Placer object is constructed --- vpr/src/place/compressed_grid.cpp | 9 +++++++++ vpr/src/place/place.cpp | 5 +++++ vpr/src/place/placer.cpp | 7 +------ vpr/src/place/placer.h | 2 -- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/vpr/src/place/compressed_grid.cpp b/vpr/src/place/compressed_grid.cpp index 0e78e6b99b..33fa04cbfc 100644 --- a/vpr/src/place/compressed_grid.cpp +++ b/vpr/src/place/compressed_grid.cpp @@ -1,6 +1,9 @@ + #include "compressed_grid.h" + #include "arch_util.h" #include "globals.h" +#include "vtr_time.h" /** * @brief Creates a compressed grid from the given locations. @@ -16,6 +19,12 @@ static t_compressed_block_grid create_compressed_block_grid(const std::vector create_compressed_block_grids() { + /* Measure how long it takes to allocate and initialize compressed grid. + * The measured execution time is printed when this object goes out of scope + * at the end of this function. + */ + vtr::ScopedStartFinishTimer compressed_grid_timer("Compressed grid construction"); + auto& device_ctx = g_vpr_ctx.device(); auto& grid = device_ctx.grid; const int num_layers = grid.get_num_layers(); diff --git a/vpr/src/place/place.cpp b/vpr/src/place/place.cpp index b090e46d0a..80a3b6edc2 100644 --- a/vpr/src/place/place.cpp +++ b/vpr/src/place/place.cpp @@ -93,6 +93,11 @@ void try_place(const Netlist<>& net_list, place_ctx.lock_loc_vars(); place_ctx.compressed_block_grids = create_compressed_block_grids(); + /* Start measuring placement time. The measured execution time will be printed + * when this object goes out of scope at the end of this function. + */ + vtr::ScopedStartFinishTimer placement_timer("Placement"); + Placer placer(net_list, placer_opts, analysis_opts, noc_opts, directs, place_delay_model, cube_bb, is_flat, /*quiet=*/false); placer.place(); diff --git a/vpr/src/place/placer.cpp b/vpr/src/place/placer.cpp index 409b1954a7..cc3bd20f0c 100644 --- a/vpr/src/place/placer.cpp +++ b/vpr/src/place/placer.cpp @@ -39,8 +39,7 @@ Placer::Placer(const Netlist<>& net_list, const auto& device_ctx = g_vpr_ctx.device(); const auto& atom_ctx = g_vpr_ctx.atom(); - const auto& timing_ctx = g_vpr_ctx.timing(); - pre_place_timing_stats_ = timing_ctx.stats; + pre_place_timing_stats_ = g_vpr_ctx.timing().stats; init_placement_context(placer_state_.mutable_blk_loc_registry(), directs); @@ -49,10 +48,6 @@ Placer::Placer(const Netlist<>& net_list, noc_cost_handler_.emplace(placer_state_.block_locs()); } - // Start measuring placement time - timer_ = std::make_unique("Placement"); - timer_->quiet(quiet); - /* To make sure the importance of NoC-related cost terms compared to * BB and timing cost is determine only through NoC placement weighting factor, * we normalize NoC-related cost weighting factors so that they add up to 1. diff --git a/vpr/src/place/placer.h b/vpr/src/place/placer.h index e5d23ff567..dbbe7466e7 100644 --- a/vpr/src/place/placer.h +++ b/vpr/src/place/placer.h @@ -96,8 +96,6 @@ class Placer { /// Stores information about the critical path. This is usually updated after that timing info is updated. tatum::TimingPathInfo critical_path_; - std::unique_ptr timer_; - IntraLbPbPinLookup pb_gpin_lookup_; ClusteredPinAtomPinsLookup netlist_pin_lookup_;