|
12 | 12 | #include "read_place.h" |
13 | 13 |
|
14 | 14 | PlacementLogPrinter::PlacementLogPrinter(const Placer& placer) |
15 | | - : placer_(placer) {} |
| 15 | + : placer_(placer) |
| 16 | + , msg_(vtr::bufsize) {} |
16 | 17 |
|
17 | 18 | void PlacementLogPrinter::print_place_status_header() const { |
18 | 19 | const bool noc_enabled = placer_.noc_opts().noc; |
@@ -44,6 +45,8 @@ void PlacementLogPrinter::print_place_status(float elapsed_sec) const { |
44 | 45 | const t_annealing_state& annealing_state = annealer.get_annealing_state(); |
45 | 46 | const auto& [swap_stats, move_type_stats, placer_stats] = annealer.get_stats(); |
46 | 47 | const int tot_moves = annealer.get_total_iteration(); |
| 48 | + const t_placer_costs& costs = placer_.costs(); |
| 49 | + std::shared_ptr<const SetupTimingInfo> timing_info = placer_.timing_info(); |
47 | 50 |
|
48 | 51 | const bool noc_enabled = placer_.noc_opts().noc; |
49 | 52 | const NocCostTerms& noc_cost_terms = placer_.costs().noc_cost_terms; |
@@ -77,6 +80,11 @@ void PlacementLogPrinter::print_place_status(float elapsed_sec) const { |
77 | 80 |
|
78 | 81 | VTR_LOG("\n"); |
79 | 82 | fflush(stdout); |
| 83 | + |
| 84 | + sprintf(msg_.data(), "Cost: %g BB Cost %g TD Cost %g Temperature: %g", |
| 85 | + costs.cost, costs.bb_cost, costs.timing_cost, annealing_state.t); |
| 86 | + |
| 87 | + update_screen(ScreenUpdatePriority::MINOR, msg_.data(), PLACEMENT, timing_info); |
80 | 88 | } |
81 | 89 |
|
82 | 90 | void PlacementLogPrinter::print_resources_utilization() const { |
@@ -177,13 +185,12 @@ void PlacementLogPrinter::print_initial_placement_stats() const { |
177 | 185 | float(num_macro_members) / blk_loc_registry.place_macros().macros().size()); |
178 | 186 | VTR_LOG("\n"); |
179 | 187 |
|
180 | | - char msg[vtr::bufsize]; |
181 | | - sprintf(msg, |
| 188 | + sprintf(msg_.data(), |
182 | 189 | "Initial Placement. Cost: %g BB Cost: %g TD Cost %g \t Channel Factor: %d", |
183 | 190 | costs.cost, costs.bb_cost, costs.timing_cost, placer_opts.place_chan_width); |
184 | 191 |
|
185 | 192 | // Draw the initial placement |
186 | | - update_screen(ScreenUpdatePriority::MAJOR, msg, PLACEMENT, timing_info); |
| 193 | + update_screen(ScreenUpdatePriority::MAJOR, msg_.data(), PLACEMENT, timing_info); |
187 | 194 |
|
188 | 195 | if (placer_opts.placement_saves_per_temperature >= 1) { |
189 | 196 | std::string filename = vtr::string_fmt("placement_%03d_%03d.place", 0, 0); |
|
0 commit comments