1212#include " read_place.h"
1313#include " tatum/echo_writer.hpp"
1414
15- PlacementLogPrinter::PlacementLogPrinter (const Placer& placer)
15+ PlacementLogPrinter::PlacementLogPrinter (const Placer& placer, bool quiet )
1616 : placer_(placer)
17- , msg_(vtr::bufsize) {}
17+ , quiet_(quiet)
18+ , msg_(quiet ? 0 : vtr::bufsize) {}
1819
1920void PlacementLogPrinter::print_place_status_header () const {
21+ if (quiet_) {
22+ return ;
23+ }
24+
2025 const bool noc_enabled = placer_.noc_opts ().noc ;
2126
2227 VTR_LOG (" \n " );
@@ -42,6 +47,10 @@ void PlacementLogPrinter::print_place_status_header() const {
4247}
4348
4449void PlacementLogPrinter::print_place_status (float elapsed_sec) const {
50+ if (quiet_) {
51+ return ;
52+ }
53+
4554 const PlacementAnnealer& annealer = placer_.annealer ();
4655 const t_annealing_state& annealing_state = annealer.get_annealing_state ();
4756 const auto & [swap_stats, move_type_stats, placer_stats] = annealer.get_stats ();
@@ -89,6 +98,10 @@ void PlacementLogPrinter::print_place_status(float elapsed_sec) const {
8998}
9099
91100void PlacementLogPrinter::print_resources_utilization () const {
101+ if (quiet_) {
102+ return ;
103+ }
104+
92105 const auto & cluster_ctx = g_vpr_ctx.clustering ();
93106 const auto & device_ctx = g_vpr_ctx.device ();
94107 const auto & block_locs = placer_.placer_state ().block_locs ();
@@ -126,6 +139,10 @@ void PlacementLogPrinter::print_resources_utilization() const {
126139}
127140
128141void PlacementLogPrinter::print_placement_swaps_stats () const {
142+ if (quiet_) {
143+ return ;
144+ }
145+
129146 const PlacementAnnealer& annealer = placer_.annealer ();
130147 const auto & [swap_stats, move_type_stats, placer_stats] = annealer.get_stats ();
131148 const t_annealing_state& annealing_state = annealer.get_annealing_state ();
@@ -148,6 +165,10 @@ void PlacementLogPrinter::print_placement_swaps_stats() const {
148165 swap_stats.num_swap_aborted , 100 * abort_rate);
149166}
150167void PlacementLogPrinter::print_initial_placement_stats () const {
168+ if (quiet_) {
169+ return ;
170+ }
171+
151172 const t_placer_costs& costs = placer_.costs ();
152173 const t_noc_opts& noc_opts = placer_.noc_opts ();
153174 const t_placer_opts& placer_opts = placer_.placer_opts ();
@@ -201,6 +222,10 @@ void PlacementLogPrinter::print_initial_placement_stats() const {
201222}
202223
203224void PlacementLogPrinter::print_post_placement_stats () const {
225+ if (quiet_) {
226+ return ;
227+ }
228+
204229 const auto & timing_ctx = g_vpr_ctx.timing ();
205230 const PlacementAnnealer& annealer = placer_.annealer ();
206231 const auto & [swap_stats, move_type_stats, placer_stats] = annealer.get_stats ();
0 commit comments