@@ -439,6 +439,7 @@ static void print_place_status(const float t,
439
439
const float rlim,
440
440
const float crit_exponent,
441
441
size_t tot_moves);
442
+ static void print_resources_utilization ();
442
443
443
444
/* ****************************************************************************/
444
445
void try_place (const t_placer_opts& placer_opts,
@@ -832,6 +833,8 @@ void try_place(const t_placer_opts& placer_opts,
832
833
833
834
report_aborted_moves ();
834
835
836
+ print_resources_utilization ();
837
+
835
838
free_placement_structs (placer_opts);
836
839
if (placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
837
840
|| placer_opts.enable_timing_computations ) {
@@ -2962,3 +2965,33 @@ static void print_place_status(const float t,
2962
2965
VTR_LOG (" %6.3f\n " , t / oldt);
2963
2966
fflush (stdout);
2964
2967
}
2968
+
2969
+ static void print_resources_utilization () {
2970
+ auto & place_ctx = g_vpr_ctx.placement ();
2971
+ auto & cluster_ctx = g_vpr_ctx.clustering ();
2972
+ auto & device_ctx = g_vpr_ctx.device ();
2973
+
2974
+ // Record the resource requirement
2975
+ std::map<t_logical_block_type_ptr, size_t > num_type_instances;
2976
+ std::map<t_logical_block_type_ptr, std::map<t_physical_tile_type_ptr, size_t >> num_placed_instances;
2977
+ for (auto blk_id : cluster_ctx.clb_nlist .blocks ()) {
2978
+ auto block_loc = place_ctx.block_locs [blk_id];
2979
+ auto loc = block_loc.loc ;
2980
+
2981
+ auto physical_tile = device_ctx.grid [loc.x ][loc.y ].type ;
2982
+ auto logical_block = cluster_ctx.clb_nlist .block_type (blk_id);
2983
+
2984
+ num_type_instances[logical_block]++;
2985
+ num_placed_instances[logical_block][physical_tile]++;
2986
+ }
2987
+
2988
+ for (auto logical_block : num_type_instances) {
2989
+ VTR_LOG (" Logical Block: %s\n " , logical_block.first ->name );
2990
+ VTR_LOG (" \t Instances -> %d\n " , logical_block.second );
2991
+
2992
+ VTR_LOG (" \t Physical Tiles used:\n " );
2993
+ for (auto physical_tile : num_placed_instances[logical_block.first ]) {
2994
+ VTR_LOG (" \t\t %s: %d\n " , physical_tile.first ->name , physical_tile.second );
2995
+ }
2996
+ }
2997
+ }
0 commit comments