Skip to content

Commit a777170

Browse files
committed
[vpr][pack] skip if net is not valid
1 parent 0008292 commit a777170

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

vpr/src/pack/prepack.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,16 +1086,18 @@ static AtomBlockId get_sink_block(const AtomBlockId block_id,
10861086

10871087
if (from_port_id) {
10881088
auto net_id = atom_nlist.port_net(from_port_id, from_pin_number);
1089-
const auto& net_sinks = atom_nlist.net_sinks(net_id);
10901089
// Iterate over all net sinks and find the one corresponding
10911090
// to the to_pin specified in the pack pattern connection
1092-
for (const auto& sink_pin_id : net_sinks) {
1093-
auto sink_block_id = atom_nlist.pin_block(sink_pin_id);
1094-
if (primitive_type_feasible(sink_block_id, to_pb_type)) {
1095-
auto to_port_id = atom_nlist.find_atom_port(sink_block_id, to_port_model);
1096-
auto to_pin_id = atom_nlist.find_pin(to_port_id, BitIndex(to_pin_number));
1097-
if (to_pin_id == sink_pin_id) {
1098-
return sink_block_id;
1091+
if (net_id.is_valid()) {
1092+
const auto& net_sinks = atom_nlist.net_sinks(net_id);
1093+
for (const auto& sink_pin_id : net_sinks) {
1094+
auto sink_block_id = atom_nlist.pin_block(sink_pin_id);
1095+
if (primitive_type_feasible(sink_block_id, to_pb_type)) {
1096+
auto to_port_id = atom_nlist.find_atom_port(sink_block_id, to_port_model);
1097+
auto to_pin_id = atom_nlist.find_pin(to_port_id, BitIndex(to_pin_number));
1098+
if (to_pin_id == sink_pin_id) {
1099+
return sink_block_id;
1100+
}
10991101
}
11001102
}
11011103
}

0 commit comments

Comments
 (0)