@@ -949,45 +949,45 @@ static void load_external_nets_and_cb(ClusteredNetlist& clb_nlist) {
949
949
* and blocks point back to net pins */
950
950
for (auto blk_id : clb_nlist.blocks ()) {
951
951
block_type = clb_nlist.block_type (blk_id);
952
- // XXX Use pin mapping here! To check that all the possible pins can be used in the correct tile!
953
- for (const auto & tile_type : block_type->equivalent_tiles ) {
954
- for (j = 0 ; j < tile_type->num_pins ; j++) {
955
- // Iterate through each pin of the block, and see if there is a net allocated/used for it
956
- clb_net_id = clb_nlist.block_net (blk_id, j);
957
-
958
- if (clb_net_id != ClusterNetId::INVALID ()) {
959
- // Verify old and new CLB netlists have the same # of pins per net
960
- if (RECEIVER == tile_type->class_inf [tile_type->pin_class [j]].type ) {
961
- count[clb_net_id]++;
962
-
963
- if (count[clb_net_id] > (int )clb_nlist.net_sinks (clb_net_id).size ()) {
964
- VPR_FATAL_ERROR (VPR_ERROR_NET_F,
965
- " net %s #%d inconsistency, expected %d terminals but encountered %d terminals, it is likely net terminal is disconnected in netlist file.\n " ,
966
- clb_nlist.net_name (clb_net_id).c_str (), size_t (clb_net_id), count[clb_net_id],
967
- clb_nlist.net_sinks (clb_net_id).size ());
968
- }
969
-
970
- // Asserts the ClusterBlockId is the same when ClusterNetId & pin BitIndex is provided
971
- VTR_ASSERT (blk_id == clb_nlist.pin_block (*(clb_nlist.net_pins (clb_net_id).begin () + count[clb_net_id])));
972
- // Asserts the block's pin index is the same
973
- VTR_ASSERT (j == clb_nlist.pin_physical_index (*(clb_nlist.net_pins (clb_net_id).begin () + count[clb_net_id])));
974
- VTR_ASSERT (j == clb_nlist.net_pin_physical_index (clb_net_id, count[clb_net_id]));
952
+ auto tile_type = pick_random_physical_type (block_type);
953
+ for (j = 0 ; j < block_type->pb_type ->num_pins ; j++) {
954
+ int phy_pin = get_physical_pin (tile_type, block_type, j);
955
+
956
+ // Iterate through each pin of the block, and see if there is a net allocated/used for it
957
+ clb_net_id = clb_nlist.block_net (blk_id, j);
958
+
959
+ if (clb_net_id != ClusterNetId::INVALID ()) {
960
+ // Verify old and new CLB netlists have the same # of pins per net
961
+ if (RECEIVER == tile_type->class_inf [tile_type->pin_class [phy_pin]].type ) {
962
+ count[clb_net_id]++;
963
+
964
+ if (count[clb_net_id] > (int )clb_nlist.net_sinks (clb_net_id).size ()) {
965
+ VPR_FATAL_ERROR (VPR_ERROR_NET_F,
966
+ " net %s #%d inconsistency, expected %d terminals but encountered %d terminals, it is likely net terminal is disconnected in netlist file.\n " ,
967
+ clb_nlist.net_name (clb_net_id).c_str (), size_t (clb_net_id), count[clb_net_id],
968
+ clb_nlist.net_sinks (clb_net_id).size ());
969
+ }
975
970
976
- // nets connecting to global pins are marked as global nets
977
- if (tile_type->is_pin_global [j]) {
978
- clb_nlist.set_net_is_global (clb_net_id, true );
979
- }
971
+ // Asserts the ClusterBlockId is the same when ClusterNetId & pin BitIndex is provided
972
+ VTR_ASSERT (blk_id == clb_nlist.pin_block (*(clb_nlist.net_pins (clb_net_id).begin () + count[clb_net_id])));
973
+ // Asserts the block's pin index is the same
974
+ VTR_ASSERT (j == clb_nlist.pin_physical_index (*(clb_nlist.net_pins (clb_net_id).begin () + count[clb_net_id])));
975
+ VTR_ASSERT (j == clb_nlist.net_pin_physical_index (clb_net_id, count[clb_net_id]));
980
976
981
- if (tile_type-> is_ignored_pin [j]) {
982
- clb_nlist. set_net_is_ignored (clb_net_id, true );
983
- }
984
- /* Error check performed later to ensure no mixing of ignored and non ignored signals */
977
+ // nets connecting to global pins are marked as global nets
978
+ if (tile_type-> is_pin_global [phy_pin]) {
979
+ clb_nlist. set_net_is_global (clb_net_id, true );
980
+ }
985
981
986
- } else {
987
- VTR_ASSERT (DRIVER == tile_type->class_inf [tile_type->pin_class [j]].type );
988
- VTR_ASSERT (j == clb_nlist.pin_physical_index (*(clb_nlist.net_pins (clb_net_id).begin ())));
989
- VTR_ASSERT (j == clb_nlist.net_pin_physical_index (clb_net_id, 0 ));
982
+ if (tile_type->is_ignored_pin [phy_pin]) {
983
+ clb_nlist.set_net_is_ignored (clb_net_id, true );
990
984
}
985
+ /* Error check performed later to ensure no mixing of ignored and non ignored signals */
986
+
987
+ } else {
988
+ VTR_ASSERT (DRIVER == tile_type->class_inf [tile_type->pin_class [phy_pin]].type );
989
+ VTR_ASSERT (j == clb_nlist.pin_physical_index (*(clb_nlist.net_pins (clb_net_id).begin ())));
990
+ VTR_ASSERT (j == clb_nlist.net_pin_physical_index (clb_net_id, 0 ));
991
991
}
992
992
}
993
993
}
0 commit comments