Skip to content

Commit 96cd664

Browse files
committed
vpr: Tweak post-placement resource usage format
New format includes enough context to parse as a single line
1 parent f063aec commit 96cd664

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

vpr/src/place/place.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,8 @@ void try_place(const t_placer_opts& placer_opts,
800800
size_t total_swap_attempts = num_swap_rejected + num_swap_accepted + num_swap_aborted;
801801
VTR_ASSERT(total_swap_attempts > 0);
802802

803+
print_resources_utilization();
804+
803805
size_t num_swap_print_digits = ceil(log10(total_swap_attempts));
804806
float reject_rate = (float)num_swap_rejected / total_swap_attempts;
805807
float accept_rate = (float)num_swap_accepted / total_swap_attempts;
@@ -812,8 +814,6 @@ void try_place(const t_placer_opts& placer_opts,
812814

813815
report_aborted_moves();
814816

815-
print_resources_utilization();
816-
817817
free_placement_structs(placer_opts);
818818
if (placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
819819
|| placer_opts.enable_timing_computations) {
@@ -2572,6 +2572,9 @@ static void print_resources_utilization() {
25722572
auto& cluster_ctx = g_vpr_ctx.clustering();
25732573
auto& device_ctx = g_vpr_ctx.device();
25742574

2575+
int max_block_name = 0;
2576+
int max_tile_name = 0;
2577+
25752578
//Record the resource requirement
25762579
std::map<t_logical_block_type_ptr, size_t> num_type_instances;
25772580
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() {
25842587

25852588
num_type_instances[logical_block]++;
25862589
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));
25872593
}
25882594

2595+
VTR_LOG("\n");
2596+
VTR_LOG("Placement resource usage:\n");
25892597
for (auto logical_block : num_type_instances) {
2590-
VTR_LOG("Logical Block: %s\n", logical_block.first->name);
2591-
VTR_LOG("\tInstances -> %d\n", logical_block.second);
2592-
2593-
VTR_LOG("\tPhysical Tiles used:\n");
25942598
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);
25962600
}
25972601
}
2602+
VTR_LOG("\n");
25982603
}

0 commit comments

Comments
 (0)