Skip to content

Commit

Permalink
Re-preserve moved sinks, also remove GND net if no sinks left
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <eddie.hung@amd.com>
  • Loading branch information
eddieh-xlnx committed Nov 15, 2024
1 parent 4dc3eeb commit 8abd584
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/com/xilinx/rapidwright/rwroute/RWRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,26 @@ protected void routeStaticNets() {
if (staticNetAndRoutingTargets.isEmpty())
return;

List<SitePinInst> gndPins = staticNetAndRoutingTargets.get(design.getGndNet());
Net gndNet = design.getGndNet();
List<SitePinInst> gndPins = staticNetAndRoutingTargets.get(gndNet);
if (gndPins != null) {
boolean invertGndToVccForLutInputs = config.isInvertGndToVccForLutInputs();
Set<SitePinInst> newVccPins = RouterHelper.invertPossibleGndPinsToVccPins(design, gndPins, invertGndToVccForLutInputs);
if (!newVccPins.isEmpty()) {
gndPins.removeAll(newVccPins);
staticNetAndRoutingTargets.computeIfAbsent(design.getVccNet(), (net) -> new ArrayList<>())
if (gndPins.isEmpty()) {
staticNetAndRoutingTargets.remove(gndNet);
}
Net vccNet = design.getVccNet();
staticNetAndRoutingTargets.computeIfAbsent(vccNet, (net) -> new ArrayList<>())
.addAll(newVccPins);
// Re-preserve these new VCC sinks
for (SitePinInst spi : newVccPins) {
Node node = spi.getConnectedNode();
assert(routingGraph.getPreservedNet(node) == gndNet);
routingGraph.unpreserve(node);
routingGraph.preserve(node, vccNet);
}
}
}

Expand Down

0 comments on commit 8abd584

Please sign in to comment.