99#include " analytic_placer.h"
1010#include " initial_placement.h"
1111#include " concrete_timing_info.h"
12- #include " tatum/echo_writer.hpp"
1312#include " verify_placement.h"
1413#include " place_timing_update.h"
1514#include " annealer.h"
1615#include " RL_agent_util.h"
1716#include " place_checkpoint.h"
17+ #include " tatum/echo_writer.hpp"
1818
1919Placer::Placer (const Netlist<>& net_list,
2020 const t_placer_opts& placer_opts,
@@ -179,17 +179,14 @@ void Placer::alloc_and_init_timing_objects_(const Netlist<>& net_list,
179179
180180 // Write out the initial timing echo file
181181 if (isEchoFileEnabled (E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH)) {
182- tatum::write_echo (
183- getEchoFileName (E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH),
184- *timing_ctx.graph , *timing_ctx.constraints ,
185- *placement_delay_calc_, timing_info_->analyzer ());
182+ tatum::write_echo (getEchoFileName (E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH),
183+ *timing_ctx.graph , *timing_ctx.constraints ,
184+ *placement_delay_calc_, timing_info_->analyzer ());
186185
187186 tatum::NodeId debug_tnode = id_or_pin_name_to_tnode (analysis_opts.echo_dot_timing_graph_node );
188187
189- write_setup_timing_graph_dot (
190- getEchoFileName (E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH)
191- + std::string (" .dot" ),
192- *timing_info_, debug_tnode);
188+ write_setup_timing_graph_dot (getEchoFileName (E_ECHO_INITIAL_PLACEMENT_TIMING_GRAPH) + std::string (" .dot" ),
189+ *timing_info_, debug_tnode);
193190 }
194191
195192 costs_.timing_cost_norm = 1 / costs_.timing_cost ;
@@ -337,8 +334,11 @@ void Placer::place() {
337334 perform_full_timing_update (crit_params, place_delay_model_.get (), placer_criticalities_.get (),
338335 placer_setup_slacks_.get (), pin_timing_invalidator_.get (),
339336 timing_info_.get (), &costs_, placer_state_);
337+
338+ critical_path_ = timing_info_->least_slack_critical_path ();
339+
340340 VTR_LOG (" post-quench CPD = %g (ns) \n " ,
341- 1e9 * timing_info_-> least_slack_critical_path () .delay ());
341+ 1e9 * critical_path_ .delay ());
342342 }
343343
344344 // See if our latest checkpoint is better than the current placement solution
@@ -369,7 +369,7 @@ void Placer::place() {
369369
370370 check_place_ ();
371371
372- print_post_placement_stats_ ();
372+ log_printer_. print_post_placement_stats ();
373373
374374 // Print out swap statistics and resource utilization
375375 log_printer_.print_resources_utilization ();
@@ -391,61 +391,6 @@ void Placer::place() {
391391 p_runtime_ctx.f_update_td_costs_total_elapsed_sec );
392392}
393393
394- void Placer::print_post_placement_stats_ () {
395- const auto & timing_ctx = g_vpr_ctx.timing ();
396- const auto & [swap_stats, move_type_stats, placer_stats] = annealer_->get_stats ();
397-
398- VTR_LOG (" \n " );
399- VTR_LOG (" Swaps called: %d\n " , swap_stats.num_ts_called );
400- // blocks_affected.move_abortion_logger.report_aborted_moves();
401-
402- if (placer_opts_.place_algorithm .is_timing_driven ()) {
403- // Final timing estimate
404- VTR_ASSERT (timing_info_);
405-
406- critical_path_ = timing_info_->least_slack_critical_path ();
407-
408- if (isEchoFileEnabled (E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH)) {
409- tatum::write_echo (getEchoFileName (E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH),
410- *timing_ctx.graph , *timing_ctx.constraints ,
411- *placement_delay_calc_, timing_info_->analyzer ());
412-
413- tatum::NodeId debug_tnode = id_or_pin_name_to_tnode (analysis_opts_.echo_dot_timing_graph_node );
414- write_setup_timing_graph_dot (getEchoFileName (E_ECHO_FINAL_PLACEMENT_TIMING_GRAPH) + std::string (" .dot" ),
415- *timing_info_, debug_tnode);
416- }
417-
418- generate_post_place_timing_reports (placer_opts_, analysis_opts_, *timing_info_,
419- *placement_delay_calc_, /* is_flat=*/ false , placer_state_.blk_loc_registry ());
420-
421- // Print critical path delay metrics
422- VTR_LOG (" \n " );
423- print_setup_timing_summary (*timing_ctx.constraints ,
424- *timing_info_->setup_analyzer (), " Placement estimated " , " " );
425- }
426-
427- char msg[vtr::bufsize];
428- sprintf (msg,
429- " Placement. Cost: %g bb_cost: %g td_cost: %g Channel Factor: %d" ,
430- costs_.cost , costs_.bb_cost , costs_.timing_cost , placer_opts_.place_chan_width );
431- VTR_LOG (" Placement cost: %g, bb_cost: %g, td_cost: %g, \n " , costs_.cost ,
432- costs_.bb_cost , costs_.timing_cost );
433- update_screen (ScreenUpdatePriority::MAJOR, msg, PLACEMENT, timing_info_);
434-
435- // print the noc costs info
436- if (noc_opts_.noc ) {
437- VTR_ASSERT (noc_cost_handler_.has_value ());
438- noc_cost_handler_->print_noc_costs (" \n NoC Placement Costs" , costs_, noc_opts_);
439-
440- #ifdef ENABLE_NOC_SAT_ROUTING
441- if (costs.noc_cost_terms .congestion > 0.0 ) {
442- VTR_LOG (" NoC routing configuration is congested. Invoking the SAT NoC router.\n " );
443- invoke_sat_router (costs, noc_opts, placer_opts.seed );
444- }
445- #endif // ENABLE_NOC_SAT_ROUTING
446- }
447- }
448-
449394void Placer::copy_locs_to_global_state () {
450395 auto & place_ctx = g_vpr_ctx.mutable_placement ();
451396
@@ -481,12 +426,15 @@ const t_placer_costs& Placer::costs() const {
481426const tatum::TimingPathInfo& Placer::critical_path () const {
482427 return critical_path_;
483428}
429+
484430std::shared_ptr<const SetupTimingInfo> Placer::timing_info () const {
485431 return timing_info_;
486432}
433+
487434const PlacerState& Placer::placer_state () const {
488435 return placer_state_;
489436}
437+
490438const std::optional<NocCostHandler>& Placer::noc_cost_handler () const {
491439 return noc_cost_handler_;
492440}
0 commit comments