@@ -800,6 +800,8 @@ void try_place(const t_placer_opts& placer_opts,
800
800
size_t total_swap_attempts = num_swap_rejected + num_swap_accepted + num_swap_aborted;
801
801
VTR_ASSERT (total_swap_attempts > 0 );
802
802
803
+ print_resources_utilization ();
804
+
803
805
size_t num_swap_print_digits = ceil (log10 (total_swap_attempts));
804
806
float reject_rate = (float )num_swap_rejected / total_swap_attempts;
805
807
float accept_rate = (float )num_swap_accepted / total_swap_attempts;
@@ -812,8 +814,6 @@ void try_place(const t_placer_opts& placer_opts,
812
814
813
815
report_aborted_moves ();
814
816
815
- print_resources_utilization ();
816
-
817
817
free_placement_structs (placer_opts);
818
818
if (placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
819
819
|| placer_opts.enable_timing_computations ) {
@@ -2572,6 +2572,9 @@ static void print_resources_utilization() {
2572
2572
auto & cluster_ctx = g_vpr_ctx.clustering ();
2573
2573
auto & device_ctx = g_vpr_ctx.device ();
2574
2574
2575
+ int max_block_name = 0 ;
2576
+ int max_tile_name = 0 ;
2577
+
2575
2578
// Record the resource requirement
2576
2579
std::map<t_logical_block_type_ptr, size_t > num_type_instances;
2577
2580
std::map<t_logical_block_type_ptr, std::map<t_physical_tile_type_ptr, size_t >> num_placed_instances;
@@ -2584,15 +2587,17 @@ static void print_resources_utilization() {
2584
2587
2585
2588
num_type_instances[logical_block]++;
2586
2589
num_placed_instances[logical_block][physical_tile]++;
2590
+
2591
+ max_block_name = std::max<int >(max_block_name, strlen (logical_block->name ));
2592
+ max_tile_name = std::max<int >(max_tile_name, strlen (physical_tile->name ));
2587
2593
}
2588
2594
2595
+ VTR_LOG (" \n " );
2596
+ VTR_LOG (" Placement resource usage:\n " );
2589
2597
for (auto logical_block : num_type_instances) {
2590
- VTR_LOG (" Logical Block: %s\n " , logical_block.first ->name );
2591
- VTR_LOG (" \t Instances -> %d\n " , logical_block.second );
2592
-
2593
- VTR_LOG (" \t Physical Tiles used:\n " );
2594
2598
for (auto physical_tile : num_placed_instances[logical_block.first ]) {
2595
- VTR_LOG (" \t\t %s : %d\n " , physical_tile.first ->name , physical_tile.second );
2599
+ VTR_LOG (" %-*s implemented as %-*s : %d\n " , max_block_name, logical_block. first -> name , max_tile_name , physical_tile.first ->name , physical_tile.second );
2596
2600
}
2597
2601
}
2602
+ VTR_LOG (" \n " );
2598
2603
}
0 commit comments