@@ -114,6 +114,8 @@ static AtomBlockId get_driving_block(const AtomBlockId block_id,
114
114
const t_pack_pattern_connections& connections,
115
115
const AtomNetlist& atom_nlist);
116
116
117
+ static t_pb_graph_pin* get_compatible_chain_root_pin (const t_pack_patterns* chain_pattern, const AtomBlockId blk_id);
118
+
117
119
static void print_chain_starting_points (t_pack_patterns* chain_pattern);
118
120
119
121
/* ****************************************/
@@ -1163,6 +1165,17 @@ static AtomBlockId get_driving_block(const AtomBlockId block_id,
1163
1165
return AtomBlockId::INVALID ();
1164
1166
}
1165
1167
1168
+ static t_pb_graph_pin* get_compatible_chain_root_pin (const t_pack_patterns* chain_pattern, const AtomBlockId blk_id) {
1169
+ for (const auto & chain : chain_pattern->chain_root_pins ) {
1170
+ for (const auto & tie_off : chain) {
1171
+ if (primitive_type_feasible (blk_id, tie_off->parent_node ->pb_type )) {
1172
+ return tie_off;
1173
+ }
1174
+ }
1175
+ }
1176
+ return nullptr ;
1177
+ }
1178
+
1166
1179
static void print_pack_molecules (const char * fname,
1167
1180
const std::vector<t_pack_patterns>& list_of_pack_patterns,
1168
1181
const int num_pack_patterns,
@@ -1324,10 +1337,9 @@ static AtomBlockId find_new_root_atom_for_chain(const AtomBlockId blk_id,
1324
1337
1325
1338
VTR_ASSERT (list_of_pack_patterns->is_chain == true );
1326
1339
VTR_ASSERT (list_of_pack_patterns->chain_root_pins .size ());
1327
- root_ipin = list_of_pack_patterns->chain_root_pins [0 ][0 ];
1328
- root_pb_graph_node = root_ipin->parent_node ;
1340
+ root_ipin = get_compatible_chain_root_pin (list_of_pack_patterns, blk_id);
1329
1341
1330
- if (primitive_type_feasible (blk_id, root_pb_graph_node-> pb_type ) == false ) {
1342
+ if (root_ipin == nullptr ) {
1331
1343
return AtomBlockId::INVALID ();
1332
1344
}
1333
1345
@@ -1622,7 +1634,7 @@ static void init_molecule_chain_info(const AtomBlockId blk_id,
1622
1634
// pattern assigned to it and the input block should be valid
1623
1635
VTR_ASSERT (molecule.pack_pattern && blk_id);
1624
1636
1625
- auto root_ipin = molecule.pack_pattern -> chain_root_pins [ 0 ][ 0 ] ;
1637
+ auto root_ipin = get_compatible_chain_root_pin ( molecule.pack_pattern , blk_id) ;
1626
1638
auto model_pin = root_ipin->port ->model_port ;
1627
1639
auto pin_bit = root_ipin->pin_number ;
1628
1640
0 commit comments