Skip to content

Commit 1dcd63b

Browse files
start measuring the placement time from the moment the Placer object is constructed
1 parent ddfec83 commit 1dcd63b

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

vpr/src/place/compressed_grid.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
12
#include "compressed_grid.h"
3+
24
#include "arch_util.h"
35
#include "globals.h"
6+
#include "vtr_time.h"
47

58
/**
69
* @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<st
1619

1720

1821
std::vector<t_compressed_block_grid> create_compressed_block_grids() {
22+
/* Measure how long it takes to allocate and initialize compressed grid.
23+
* The measured execution time is printed when this object goes out of scope
24+
* at the end of this function.
25+
*/
26+
vtr::ScopedStartFinishTimer compressed_grid_timer("Compressed grid construction");
27+
1928
auto& device_ctx = g_vpr_ctx.device();
2029
auto& grid = device_ctx.grid;
2130
const int num_layers = grid.get_num_layers();

vpr/src/place/place.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ void try_place(const Netlist<>& net_list,
9393
place_ctx.lock_loc_vars();
9494
place_ctx.compressed_block_grids = create_compressed_block_grids();
9595

96+
/* Start measuring placement time. The measured execution time will be printed
97+
* when this object goes out of scope at the end of this function.
98+
*/
99+
vtr::ScopedStartFinishTimer placement_timer("Placement");
100+
96101
Placer placer(net_list, placer_opts, analysis_opts, noc_opts, directs, place_delay_model, cube_bb, is_flat, /*quiet=*/false);
97102

98103
placer.place();

vpr/src/place/placer.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ Placer::Placer(const Netlist<>& net_list,
3939
const auto& device_ctx = g_vpr_ctx.device();
4040
const auto& atom_ctx = g_vpr_ctx.atom();
4141

42-
const auto& timing_ctx = g_vpr_ctx.timing();
43-
pre_place_timing_stats_ = timing_ctx.stats;
42+
pre_place_timing_stats_ = g_vpr_ctx.timing().stats;
4443

4544
init_placement_context(placer_state_.mutable_blk_loc_registry(), directs);
4645

@@ -49,10 +48,6 @@ Placer::Placer(const Netlist<>& net_list,
4948
noc_cost_handler_.emplace(placer_state_.block_locs());
5049
}
5150

52-
// Start measuring placement time
53-
timer_ = std::make_unique<vtr::ScopedStartFinishTimer>("Placement");
54-
timer_->quiet(quiet);
55-
5651
/* To make sure the importance of NoC-related cost terms compared to
5752
* BB and timing cost is determine only through NoC placement weighting factor,
5853
* we normalize NoC-related cost weighting factors so that they add up to 1.

vpr/src/place/placer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ class Placer {
9696
/// Stores information about the critical path. This is usually updated after that timing info is updated.
9797
tatum::TimingPathInfo critical_path_;
9898

99-
std::unique_ptr<vtr::ScopedStartFinishTimer> timer_;
100-
10199
IntraLbPbPinLookup pb_gpin_lookup_;
102100
ClusteredPinAtomPinsLookup netlist_pin_lookup_;
103101

0 commit comments

Comments
 (0)