@@ -514,15 +514,14 @@ void print_resource_usage() {
514
514
VTR_LOG (" Resource usage...\n " );
515
515
for (const auto & type : device_ctx.logical_block_types ) {
516
516
if (is_empty_type (&type)) continue ;
517
-
517
+ size_t num_instances = num_type_instances. count (&type) > 0 ? num_type_instances. at (&type) : 0 ;
518
518
VTR_LOG (" \t Netlist\n\t\t %d\t blocks of type: %s\n " ,
519
- num_type_instances. at (&type) , type.name .c_str ());
519
+ num_instances , type.name .c_str ());
520
520
521
521
VTR_LOG (" \t Architecture\n " );
522
522
for (const auto equivalent_tile : type.equivalent_tiles ) {
523
- auto num_instances = 0 ;
524
523
// get the number of equivalent tile across all layers
525
- num_instances = ( int ) device_ctx.grid .num_instances (equivalent_tile, -1 );
524
+ num_instances = device_ctx.grid .num_instances (equivalent_tile, -1 );
526
525
527
526
VTR_LOG (" \t\t %d\t blocks of type: %s\n " ,
528
527
num_instances, equivalent_tile->name .c_str ());
@@ -555,7 +554,8 @@ void print_device_utilization(const float target_device_utilization) {
555
554
float util = 0 .;
556
555
size_t num_inst = device_ctx.grid .num_instances (&type, -1 );
557
556
if (num_inst != 0 ) {
558
- util = float (num_type_instances.at (logical_block)) / num_inst;
557
+ size_t num_netlist_instances = num_type_instances.count (logical_block) > 0 ? num_type_instances.at (logical_block) : 0 ;
558
+ util = float (num_netlist_instances) / num_inst;
559
559
}
560
560
VTR_LOG (" \t Block Utilization: %.2f Logical Block: %s\n " , util, logical_block->name .c_str ());
561
561
}
0 commit comments