Skip to content

Commit

Permalink
RouteThruHelper.isRouteThruPIPAvailable(Design, WireInterface, WireIn… (
Browse files Browse the repository at this point in the history
#915)

* Create a common interface for Node and Wire Objects

Signed-off-by: Chris Lavin <[email protected]>

* Refactor WireObject->WireInterface

Signed-off-by: Chris Lavin <[email protected]>

* Adds hashCode() and equals() and Javadocs

Signed-off-by: Chris Lavin <[email protected]>

* Adds a test

Signed-off-by: Chris Lavin <[email protected]>

* Add missing license header

Signed-off-by: Chris Lavin <[email protected]>

* Add default method for get{Tile,Wire}Name(), remove public

Signed-off-by: Eddie Hung <[email protected]>

* RouteThruHelper.isRouteThruPIPAvailable(Design, WireInterface, WireInterface)

Signed-off-by: Eddie Hung <[email protected]>

---------

Signed-off-by: Chris Lavin <[email protected]>
Signed-off-by: Eddie Hung <[email protected]>
Co-authored-by: Chris Lavin <[email protected]>
  • Loading branch information
eddieh-xlnx and clavin-xlnx authored Jan 10, 2024
1 parent 1f0fcce commit 9067e01
Showing 1 changed file with 3 additions and 41 deletions.
44 changes: 3 additions & 41 deletions src/com/xilinx/rapidwright/router/RouteThruHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.xilinx.rapidwright.device.Tile;
import com.xilinx.rapidwright.device.TileTypeEnum;
import com.xilinx.rapidwright.device.Wire;
import com.xilinx.rapidwright.device.WireInterface;
import com.xilinx.rapidwright.util.FileTools;

/**
Expand Down Expand Up @@ -182,50 +183,11 @@ public static boolean isRouteThruSitePinAvailable(Design design, SitePin sitePin
}

/**
* Given two Wire objects (assumed to make up a routethru PIP) check that this
* Given two WireInterface objects (assumed to make up a routethru PIP) check that this
* PIP is available for use by checking for net and cell collisions within the site
* it is routing through.
* Note that this method is identical to the {@link #isRouteThruPIPAvailable(Design, Node, Node)}
* overload, kept separate to minimize unnecessary calling Node.getSitePin().
*/
public static boolean isRouteThruPIPAvailable(Design design, Wire start, Wire end) {
SitePin outPin = end.getSitePin();
if (!isRouteThruSitePinAvailable(design, outPin)) {
return false;
}
SitePin inPin = start.getSitePin();
if (!isRouteThruSitePinAvailable(design, inPin)) {
return false;
}
assert(inPin.getSite() == outPin.getSite());

SiteInst siteInst = design.getSiteInstFromSite(inPin.getSite());
if (siteInst != null) {
for (BELPin sink : inPin.getBELPin().getSiteConns()) {
BEL sinkBEL = sink.getBEL();
if (sinkBEL.getName().charAt(0) != inPin.getPinName().charAt(0)) {
continue;
}
Cell cellCollision = siteInst.getCell(sinkBEL);
if (cellCollision != null) {
// Ignore BELs that don't share the same LUT letter
// Specifically, this is to prevent H[1-6] inputs on SLICEM sites
// -- which also drive [A-G].WA[1-6] -- from considering [A-G]LUT[56]
return false;
}
}
}
return true;
}

/**
* Given two Node objects (assumed to make up a routethru PIP) check that this
* PIP is available for use by checking for net and cell collisions within the site
* it is routing through.
* Note that this method is identical to the {@link #isRouteThruPIPAvailable(Design, Wire, Wire)}
* overload, kept separate to minimize unnecessary calling Node.getSitePin().
*/
public static boolean isRouteThruPIPAvailable(Design design, Node start, Node end) {
public static boolean isRouteThruPIPAvailable(Design design, WireInterface start, WireInterface end) {
SitePin outPin = end.getSitePin();
if (!isRouteThruSitePinAvailable(design, outPin)) {
return false;
Expand Down

0 comments on commit 9067e01

Please sign in to comment.