Skip to content

Commit

Permalink
start measuring the placement time from the moment the Placer object …
Browse files Browse the repository at this point in the history
…is constructed
  • Loading branch information
soheilshahrouz committed Nov 27, 2024
1 parent ddfec83 commit 1dcd63b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
9 changes: 9 additions & 0 deletions vpr/src/place/compressed_grid.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -16,6 +19,12 @@ static t_compressed_block_grid create_compressed_block_grid(const std::vector<st


std::vector<t_compressed_block_grid> 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();
Expand Down
5 changes: 5 additions & 0 deletions vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 1 addition & 6 deletions vpr/src/place/placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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<vtr::ScopedStartFinishTimer>("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.
Expand Down
2 changes: 0 additions & 2 deletions vpr/src/place/placer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<vtr::ScopedStartFinishTimer> timer_;

IntraLbPbPinLookup pb_gpin_lookup_;
ClusteredPinAtomPinsLookup netlist_pin_lookup_;

Expand Down

0 comments on commit 1dcd63b

Please sign in to comment.