Skip to content

Commit d28d56d

Browse files
alloc_lookups_and_delay_model returns a unique_ptr instead of shared_ptr
1 parent 726f376 commit d28d56d

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

vpr/src/place/place_delay_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void OverrideDelayModel::write(const std::string& file) const {
318318
#endif
319319

320320
///@brief Initialize the placer delay model.
321-
std::shared_ptr<PlaceDelayModel> alloc_lookups_and_delay_model(const Netlist<>& net_list,
321+
std::unique_ptr<PlaceDelayModel> alloc_lookups_and_delay_model(const Netlist<>& net_list,
322322
t_chan_width_dist chan_width_dist,
323323
const t_placer_opts& placer_opts,
324324
const t_router_opts& router_opts,

vpr/src/place/place_delay_model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class PlaceDelayModel;
2929
class PlacerState;
3030

3131
///@brief Initialize the placer delay model.
32-
std::shared_ptr<PlaceDelayModel> alloc_lookups_and_delay_model(const Netlist<>& net_list,
32+
std::unique_ptr<PlaceDelayModel> alloc_lookups_and_delay_model(const Netlist<>& net_list,
3333
t_chan_width_dist chan_width_dist,
3434
const t_placer_opts& place_opts,
3535
const t_router_opts& router_opts,

vpr/src/place/placer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void Placer::place() {
281281

282282
bool skip_anneal = false;
283283
#ifdef ENABLE_ANALYTIC_PLACE
284-
// When enabled, skip most of the annealing and go straight to quench
284+
// Cluster-level analytic placer: when enabled, skip most of the annealing and go straight to quench
285285
if (placer_opts_.enable_analytic_placer) {
286286
skip_anneal = true;
287287
}

vpr/src/place/placer.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ class Placer {
7979

8080
/// Stores a placement state as a retrievable checkpoint in case the placement quality deteriorates later.
8181
t_placement_checkpoint placement_checkpoint_;
82-
/// It holds a setup timing analysis engine. Other placement timing object usually have a reference or pointer to timing_info.
82+
/**
83+
* @brief Holds a setup timing analysis engine.
84+
* Other placement timing objects like PlacerSetupSlacks, PlacerCriticalities, and NetPinTimingInvalidator
85+
* have a pointer to timing_info. A shared pointer is used to manage the lifetime of the object.
86+
*/
8387
std::shared_ptr<SetupTimingInfo> timing_info_;
8488
/// Post-clustering delay calculator. Its API allows extraction of delay for each timing edge.
8589
std::shared_ptr<PlacementDelayCalculator> placement_delay_calc_;

vpr/src/place/timing_place_lookup.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static float find_neighboring_average(vtr::NdMatrix<float, 4>& matrix,
170170

171171
/******* Globally Accessible Functions **********/
172172

173-
std::shared_ptr<PlaceDelayModel> compute_place_delay_model(const t_placer_opts& placer_opts,
173+
std::unique_ptr<PlaceDelayModel> compute_place_delay_model(const t_placer_opts& placer_opts,
174174
const t_router_opts& router_opts,
175175
const Netlist<>& net_list,
176176
t_det_routing_arch* det_routing_arch,
@@ -196,15 +196,15 @@ std::shared_ptr<PlaceDelayModel> compute_place_delay_model(const t_placer_opts&
196196
int longest_length = get_longest_segment_length(segment_inf);
197197

198198
/*now setup and compute the actual arrays */
199-
std::shared_ptr<PlaceDelayModel> place_delay_model;
199+
std::unique_ptr<PlaceDelayModel> place_delay_model;
200200
float min_cross_layer_delay = get_min_cross_layer_delay();
201201

202202
if (placer_opts.delay_model_type == PlaceDelayModelType::SIMPLE) {
203-
place_delay_model = std::make_shared<SimpleDelayModel>();
203+
place_delay_model = std::make_unique<SimpleDelayModel>();
204204
} else if (placer_opts.delay_model_type == PlaceDelayModelType::DELTA) {
205-
place_delay_model = std::make_shared<DeltaDelayModel>(min_cross_layer_delay, is_flat);
205+
place_delay_model = std::make_unique<DeltaDelayModel>(min_cross_layer_delay, is_flat);
206206
} else if (placer_opts.delay_model_type == PlaceDelayModelType::DELTA_OVERRIDE) {
207-
place_delay_model = std::make_shared<OverrideDelayModel>(min_cross_layer_delay, is_flat);
207+
place_delay_model = std::make_unique<OverrideDelayModel>(min_cross_layer_delay, is_flat);
208208
} else {
209209
VTR_ASSERT_MSG(false, "Invalid placer delay model");
210210
}

vpr/src/place/timing_place_lookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define TIMING_PLACE_LOOKUP_H
33
#include "place_delay_model.h"
44

5-
std::shared_ptr<PlaceDelayModel> compute_place_delay_model(const t_placer_opts& placer_opts,
5+
std::unique_ptr<PlaceDelayModel> compute_place_delay_model(const t_placer_opts& placer_opts,
66
const t_router_opts& router_opts,
77
const Netlist<>& net_list,
88
t_det_routing_arch* det_routing_arch,

0 commit comments

Comments
 (0)