@@ -435,18 +435,23 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
435
435
}
436
436
437
437
// Display text for each physical block.
438
+ std::string pb_display_text (pb_type->name );
438
439
std::string pb_type_name (pb_type->name );
439
440
440
441
if (!pb->is_primitive ()) {
441
442
// Format for non-primitives: <block_type_name>[<placement_index>]:<mode_name>
442
- pb_type_name += " [" + std::to_string (pb->pb_graph_node ->placement_index ) + " ]" ;
443
443
std::string mode_name = pb->pb_graph_node ->pb_type ->modes [pb->mode ].name ;
444
- pb_type_name += " :" + mode_name;
444
+ pb_display_text += " [" + std::to_string (pb->pb_graph_node ->placement_index ) + " ]" ;
445
+
446
+ // Don't display mode name if it is the same as the pb_type name
447
+ if (mode_name != pb_type_name) {
448
+ pb_display_text += " :" + mode_name;
449
+ }
445
450
} else {
446
451
// Format for primitives: <block_type_name>(<block_name>)
447
452
if (pb->name != nullptr ) {
448
453
std::string pb_name (pb->name );
449
- pb_type_name += " (" + pb_name + " )" ;
454
+ pb_display_text += " (" + pb_name + " )" ;
450
455
}
451
456
}
452
457
@@ -458,7 +463,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
458
463
if (draw_state->draw_block_text ) {
459
464
g->draw_text (
460
465
abs_bbox.center (),
461
- pb_type_name .c_str (),
466
+ pb_display_text .c_str (),
462
467
abs_bbox.width (),
463
468
abs_bbox.height ());
464
469
}
@@ -470,7 +475,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
470
475
g->draw_text (
471
476
ezgl::point2d (abs_bbox.center_x (),
472
477
abs_bbox.top () - draw_coords->get_tile_height () * FRACTION_TEXT_PADDING),
473
- pb_type_name .c_str (),
478
+ pb_display_text .c_str (),
474
479
abs_bbox.width (),
475
480
abs_bbox.height ());
476
481
}
0 commit comments