@@ -584,27 +584,23 @@ int find_clb_pb_pin(ClusterBlockId clb, int clb_pin) {
584
584
585
585
auto & clb_nlist = cluster_ctx.clb_nlist ;
586
586
587
- t_type_ptr equivalent_type = clb_nlist.block_type (clb);
588
- t_type_ptr original_type = clb_nlist.block_type (clb, false );
589
-
590
- bool eq_type_selected = original_type == equivalent_type ? false : true ;
591
-
592
- VTR_ASSERT_MSG (clb_pin < equivalent_type->num_pins , " Must be a valid top-level pin" );
587
+ int eq_type_index = clb_nlist.block_eq_type_index (clb);
588
+ auto type = clb_nlist.block_type (clb);
593
589
594
590
int pin = clb_pin;
595
591
596
- if (eq_type_selected) {
597
- int equivalent_type_index = clb_nlist. block_eq_type_index (clb);
598
- VTR_ASSERT (equivalent_type_index != OPEN);
599
- pin = original_type ->equivalent_tile_inverse_pin_mapping [equivalent_type_index ][clb_pin];
592
+ // In case an equivalent tile is selected, the CLB block type will be different (e.g. CLB logic type is LAB, CLB physical type is MLAB).
593
+ // Therefore, I need to retrieve the pin mapping from the LAB type by setting the `false` flag when calling block_type.
594
+ if (eq_type_index != OPEN) {
595
+ pin = clb_nlist. block_type (clb, false ) ->equivalent_tile_inverse_pin_mapping [eq_type_index ][clb_pin];
600
596
}
601
597
602
- int pb_pin = - 1 ;
598
+ int pb_pin = OPEN ;
603
599
if (place_ctx.block_locs [clb].nets_and_pins_synced_to_z_coordinate ) {
604
600
// Pins have been offset by z-coordinate, need to remove offset
605
601
606
- VTR_ASSERT (equivalent_type ->num_pins % equivalent_type ->capacity == 0 );
607
- int num_basic_block_pins = equivalent_type ->num_pins / equivalent_type ->capacity ;
602
+ VTR_ASSERT (type ->num_pins % type ->capacity == 0 );
603
+ int num_basic_block_pins = type ->num_pins / type ->capacity ;
608
604
/* Logical location and physical location is offset by z * max_num_block_pins */
609
605
610
606
pb_pin = pin + place_ctx.block_locs [clb].z * num_basic_block_pins;
@@ -624,24 +620,22 @@ int find_pb_pin_clb_pin(ClusterBlockId clb, int pb_pin) {
624
620
625
621
auto & clb_nlist = cluster_ctx.clb_nlist ;
626
622
627
- t_type_ptr equivalent_type = clb_nlist.block_type (clb);
628
- t_type_ptr original_type = clb_nlist.block_type (clb, false );
629
-
630
- bool eq_type_selected = original_type == equivalent_type ? false : true ;
623
+ int eq_type_index = clb_nlist.block_eq_type_index (clb);
624
+ auto type = clb_nlist.block_type (clb);
631
625
632
626
int pin = pb_pin;
633
627
634
- if (eq_type_selected) {
635
- int equivalent_type_index = clb_nlist. block_eq_type_index (clb);
636
- VTR_ASSERT (equivalent_type_index != OPEN);
637
- pin = original_type ->equivalent_tile_pin_mapping [equivalent_type_index ][pb_pin];
628
+ // In case an equivalent tile is selected, the CLB block type will be different (e.g. CLB logic type is LAB, CLB physical type is MLAB).
629
+ // Therefore, I need to retrieve the pin mapping from the LAB type by setting the `false` flag when calling block_type.
630
+ if (eq_type_index != OPEN) {
631
+ pin = clb_nlist. block_type (clb, false ) ->equivalent_tile_pin_mapping [eq_type_index ][pb_pin];
638
632
}
639
633
640
- int clb_pin = - 1 ;
634
+ int clb_pin = OPEN ;
641
635
if (place_ctx.block_locs [clb].nets_and_pins_synced_to_z_coordinate ) {
642
636
// Pins have been offset by z-coordinate, need to remove offset
643
- VTR_ASSERT (equivalent_type ->num_pins % equivalent_type ->capacity == 0 );
644
- int num_basic_block_pins = equivalent_type ->num_pins / equivalent_type ->capacity ;
637
+ VTR_ASSERT (type ->num_pins % type ->capacity == 0 );
638
+ int num_basic_block_pins = type ->num_pins / type ->capacity ;
645
639
/* Logical location and physical location is offset by z * max_num_block_pins */
646
640
647
641
clb_pin = pin + place_ctx.block_locs [clb].z * num_basic_block_pins;
0 commit comments