@@ -435,18 +435,23 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
435435 }
436436
437437 // Display text for each physical block.
438+ std::string pb_display_text (pb_type->name );
438439 std::string pb_type_name (pb_type->name );
439440
440441 if (!pb->is_primitive ()) {
441442 // Format for non-primitives: <block_type_name>[<placement_index>]:<mode_name>
442- pb_type_name += " [" + std::to_string (pb->pb_graph_node ->placement_index ) + " ]" ;
443443 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+ }
445450 } else {
446451 // Format for primitives: <block_type_name>(<block_name>)
447452 if (pb->name != nullptr ) {
448453 std::string pb_name (pb->name );
449- pb_type_name += " (" + pb_name + " )" ;
454+ pb_display_text += " (" + pb_name + " )" ;
450455 }
451456 }
452457
@@ -458,7 +463,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
458463 if (draw_state->draw_block_text ) {
459464 g->draw_text (
460465 abs_bbox.center (),
461- pb_type_name .c_str (),
466+ pb_display_text .c_str (),
462467 abs_bbox.width (),
463468 abs_bbox.height ());
464469 }
@@ -470,7 +475,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
470475 g->draw_text (
471476 ezgl::point2d (abs_bbox.center_x (),
472477 abs_bbox.top () - draw_coords->get_tile_height () * FRACTION_TEXT_PADDING),
473- pb_type_name .c_str (),
478+ pb_display_text .c_str (),
474479 abs_bbox.width (),
475480 abs_bbox.height ());
476481 }
0 commit comments