Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx committed Dec 24, 2024
1 parent 075298e commit 5b23131
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/com/xilinx/rapidwright/design/DesignTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,8 @@ public static boolean stampPlacement(Design design, Module stamp, Map<String,Sit
}

/**
* Looks in the site instance for BEL pins connected to this site pin.
* Looks in the site instance for used BEL pins connected to this site pin.
* Will walk through used SitePIPs and routethru cells (e.g. LUTs, IMR registers, etc.)
* @param pin The BELPin to examine for connected BEL pins.
* @param si The SiteInst to examine for connected cells.
* @param action Perform this action on each connected BELPin.
Expand All @@ -2020,6 +2021,7 @@ private static void foreachConnectedBELPin(BELPin pin, SiteInst si, Consumer<BEL
p = pip.getInputPin().getSiteConns().get(0);
action.accept(p);
} else {
// Walk through any used SitePIPs
foreachConnectedBELPin(pip.getOutputPin(), si, action);
}
} else {
Expand All @@ -2042,7 +2044,8 @@ private static void foreachConnectedBELPin(BELPin pin, SiteInst si, Consumer<BEL
}

/**
* Looks in the site instance for cells connected to this BEL pin and SiteInst.
* Looks in the site instance for used cells connected to this BEL pin and SiteInst.
* Will walk through used SitePIPs and routethru cells (e.g. LUTs, IMR registers, etc.)
* @param pin The BELPin to examine for connected cells.
* @param si The SiteInst to examine for connected cells.
* @return Set of connected cells to this pin.
Expand All @@ -2060,6 +2063,7 @@ public static Set<Cell> getConnectedCells(BELPin pin, SiteInst si) {

/**
* Looks in the site instance for cells connected to this site pin.
* Will walk through used SitePIPs and routethru cells (e.g. LUTs, IMR registers, etc.)
* @param pin The SitePinInst to examine for connected cells.
* @return Set of connected cells to this pin.
*/
Expand All @@ -2069,6 +2073,7 @@ public static Set<Cell> getConnectedCells(SitePinInst pin) {

/**
* Looks in the site instance for BEL pins connected to this BEL pin and SiteInst.
* Will walk through used SitePIPs and routethru cells (e.g. LUTs, IMR registers, etc.)
* @param pin The SitePinInst to examine for connected BEL pins.
* @param si The SiteInst to examine for connected cells.
* @return Set of BEL pins to this site pin.
Expand Down
7 changes: 3 additions & 4 deletions src/com/xilinx/rapidwright/rwroute/RouterHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ public static Set<SitePinInst> invertPossibleGndPinsToVccPins(Design design,
SiteInst si = spi.getSiteInst();
String siteWireName = spi.getSiteWireName();
if (invertLutInputs && spi.isLUTInputPin()) {
BELPin spiBelPin = spi.getBELPin();
Collection<Cell> connectedCells = DesignTools.getConnectedCells(spiBelPin, si);
Collection<Cell> connectedCells = DesignTools.getConnectedCells(spi);
if (connectedCells.isEmpty()) {
for (BELPin belPin : si.getSiteWirePins(spiBelPin.getSiteWireName())) {
for (BELPin belPin : si.getSiteWirePins(spi.getSiteWireName())) {
if (belPin.isSitePort()) {
continue;
}
Expand Down Expand Up @@ -405,7 +404,7 @@ public static Set<SitePinInst> invertPossibleGndPinsToVccPins(Design design,
toInvertPins.add(spi);
// Re-paint the intra-site routing from GND to VCC
// (no intra site routing will occur during Net.addPin() later)
si.routeIntraSiteNet(vccNet, spi.getBELPin(), spiBelPin);
si.routeIntraSiteNet(vccNet, spi.getBELPin(), spi.getBELPin());

for (Cell cell : connectedCells) {
// Find the logical pin name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ public void testGetConnectedBELPins() {
{
DesignTools.createMissingSitePinInsts(design, design.getNet("clk"));
SitePinInst spi = si.getSitePinInst("CLK2");
Assertions.assertNull(si.getCell("EF2"));
Assertions.assertEquals("[EFF.CLK, FFF.CLK, FFF2.CLK, GFF.CLK, GFF2.CLK, HFF.CLK, HFF2.CLK]",
DesignTools.getConnectedBELPins(spi).stream().map(BELPin::toString).sorted().collect(Collectors.toList()).toString());
}
Expand Down

0 comments on commit 5b23131

Please sign in to comment.