Skip to content

Commit

Permalink
add is_flat to Placer
Browse files Browse the repository at this point in the history
  • Loading branch information
soheilshahrouz committed Nov 20, 2024
1 parent 87f4e2e commit d923d75
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void try_place(const Netlist<>& net_list,
place_ctx.lock_loc_vars();
place_ctx.compressed_block_grids = create_compressed_block_grids();

Placer placer(net_list, placer_opts, analysis_opts, noc_opts, directs, place_delay_model, cube_bb);
Placer placer(net_list, placer_opts, analysis_opts, noc_opts, directs, place_delay_model, cube_bb, is_flat, /*quiet=*/false);

#ifndef NO_GRAPHICS
if (placer.noc_cost_handler().has_value()) {
Expand Down
12 changes: 7 additions & 5 deletions vpr/src/place/placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Placer::Placer(const Netlist<>& net_list,
const t_noc_opts& noc_opts,
const std::vector<t_direct_inf>& directs,
std::shared_ptr<PlaceDelayModel> place_delay_model,
bool cube_bb)
bool cube_bb,
bool is_flat,
bool quiet)
: placer_opts_(placer_opts)
, analysis_opts_(analysis_opts)
, noc_opts_(noc_opts)
Expand All @@ -31,7 +33,8 @@ Placer::Placer(const Netlist<>& net_list,
, rng_(placer_opts.seed)
, net_cost_handler_(placer_opts, placer_state_, cube_bb)
, place_delay_model_(std::move(place_delay_model))
, log_printer_(*this, /*quiet*/false) {
, log_printer_(*this, quiet)
, is_flat_(is_flat) {
const auto& cluster_ctx = g_vpr_ctx.clustering();
const auto& device_ctx = g_vpr_ctx.device();
const auto& atom_ctx = g_vpr_ctx.atom();
Expand Down Expand Up @@ -61,7 +64,6 @@ Placer::Placer(const Netlist<>& net_list,
normalize_noc_cost_weighting_factor(const_cast<t_noc_opts&>(noc_opts));
}


BlkLocRegistry& blk_loc_registry = placer_state_.mutable_blk_loc_registry();
initial_placement(placer_opts, placer_opts.constraints_file.c_str(),
noc_opts, blk_loc_registry, noc_cost_handler_, rng_);
Expand Down Expand Up @@ -151,7 +153,7 @@ void Placer::alloc_and_init_timing_objects_(const Netlist<>& net_list,
placement_delay_calc_ = std::make_shared<PlacementDelayCalculator>(atom_ctx.nlist,
atom_ctx.lookup,
p_timing_ctx.connection_delay,
/*is_flat=*/false);
is_flat_);
placement_delay_calc_->set_tsu_margin_relative(placer_opts_.tsu_rel_margin);
placement_delay_calc_->set_tsu_margin_absolute(placer_opts_.tsu_abs_margin);

Expand All @@ -167,7 +169,7 @@ void Placer::alloc_and_init_timing_objects_(const Netlist<>& net_list,
atom_ctx.nlist,
atom_ctx.lookup,
*timing_info_->timing_graph(),
/*is_flat=*/false);
is_flat_);

// First time compute timing and costs, compute from scratch
PlaceCritParams crit_params;
Expand Down
10 changes: 6 additions & 4 deletions vpr/src/place/placer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class Placer {
const t_noc_opts& noc_opts,
const std::vector<t_direct_inf>& directs,
std::shared_ptr<PlaceDelayModel> place_delay_model,
bool cube_bb);
bool cube_bb,
bool is_flat,
bool quiet);

void place();

Expand Down Expand Up @@ -55,7 +57,6 @@ class Placer {

const std::optional<NocCostHandler>& noc_cost_handler() const;

//TODO: make this private
private:
const t_placer_opts& placer_opts_;
const t_analysis_opts& analysis_opts_;
Expand All @@ -66,6 +67,8 @@ class Placer {
NetCostHandler net_cost_handler_;
std::optional<NocCostHandler> noc_cost_handler_;
std::shared_ptr<PlaceDelayModel> place_delay_model_;
const PlacementLogPrinter log_printer_;
const bool is_flat_;

t_placement_checkpoint placement_checkpoint_;

Expand All @@ -76,15 +79,14 @@ class Placer {
std::unique_ptr<NetPinTimingInvalidator> pin_timing_invalidator_;
tatum::TimingPathInfo critical_path_;


std::unique_ptr<vtr::ScopedStartFinishTimer> timer_;

IntraLbPbPinLookup pb_gpin_lookup_;
ClusteredPinAtomPinsLookup netlist_pin_lookup_;

std::unique_ptr<PlacementAnnealer> annealer_;

const PlacementLogPrinter log_printer_;


t_timing_analysis_profile_info pre_place_timing_stats_;
t_timing_analysis_profile_info pre_quench_timing_stats_;
Expand Down

0 comments on commit d923d75

Please sign in to comment.