diff --git a/openfpga/src/repack/repack.cpp b/openfpga/src/repack/repack.cpp index 91efe88c8..3611909bb 100644 --- a/openfpga/src/repack/repack.cpp +++ b/openfpga/src/repack/repack.cpp @@ -259,13 +259,25 @@ std::vector find_pb_route_remapped_source_pb_pin(const t_pb* pb, /* Only care the pin has the same parent port as source_pb_pin * Due to that the source_pb_pin may be swapped during routing * the pb_route is out-of-date + * + * For those parent port is defined as non-equivalent, + * the source pin and the pin recorded in the routing trace must match! + * * TODO: should update pb_route by post routing results * On the other side, the swapping can only happen between equivalent pins * in a port. So the port must match here! */ - if (source_pb_pin->port == pb->pb_route.at(pin).pb_graph_pin->port) { - pb_route_indices.push_back(pin); - } + if (PortEquivalence::FULL == source_pb_pin->port->equivalent) { + if (source_pb_pin->port == pb->pb_route.at(pin).pb_graph_pin->port) { + pb_route_indices.push_back(pin); + } + } else { + /* NOTE: INSTANCE is NOT supported! We support only NONE equivalent */ + VTR_ASSERT (PortEquivalence::NONE == source_pb_pin->port->equivalent); + if (source_pb_pin == pb->pb_route.at(pin).pb_graph_pin) { + pb_route_indices.push_back(pin); + } + } } return pb_route_indices;