Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DesignTools] updatePinsIsRouted() to return num unrouted sinks
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
eddieh-xlnx committed Dec 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f803bdc commit d6e7b42
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/com/xilinx/rapidwright/design/DesignTools.java
Original file line number Diff line number Diff line change
@@ -4367,13 +4367,18 @@ public static void addProhibitConstraint(Design design, List<String> belLocation
* tied to GND or VCC) when following the Net's PIPs.
* A source pin will be marked as being routed if it drives at least one PIP.
* @param net Net on which pins are to be updated.
* @return Number of unrouted sink pins on net.
*/
public static void updatePinsIsRouted(Net net) {
public static int updatePinsIsRouted(Net net) {
int numUnroutedSinkPins = 0;
for (SitePinInst spi : net.getPins()) {
spi.setRouted(false);
if (!spi.isOutPin()) {
numUnroutedSinkPins++;
}
}
if (!net.hasPIPs()) {
return;
return numUnroutedSinkPins;
}

Map<Node, SitePinInst> node2spi = new HashMap<>();
@@ -4392,23 +4397,31 @@ public static void updatePinsIsRouted(Net net) {
}
while (!queue.isEmpty()) {
NetTools.NodeTree node = queue.poll();
SitePinInst spi = node2spi.get(node);
SitePinInst spi = node2spi.remove(node);
if (spi != null) {
spi.setRouted(true);
if (!spi.isOutPin()) {
assert(numUnroutedSinkPins > 0);
numUnroutedSinkPins--;
}
}
queue.addAll(node.fanouts);
}
return numUnroutedSinkPins;
}

/**
* Update the SitePinInst.isRouted() value of all sink pins in the given
* Design. See {@link #updatePinsIsRouted(Net)}.
* @param design Design in which pins are to be updated.
* @return Number of unrouted sink pins across design.
*/
public static void updatePinsIsRouted(Design design) {
public static int updatePinsIsRouted(Design design) {
int numUnroutedSinkPins = 0;
for (Net net : design.getNets()) {
updatePinsIsRouted(net);
numUnroutedSinkPins += updatePinsIsRouted(net);
}
return numUnroutedSinkPins;
}

/**

0 comments on commit d6e7b42

Please sign in to comment.