From 9067e01e5ac238c4797b46ef02923a9c766a558d Mon Sep 17 00:00:00 2001 From: eddieh-xlnx Date: Tue, 9 Jan 2024 21:54:34 -0800 Subject: [PATCH] =?UTF-8?q?RouteThruHelper.isRouteThruPIPAvailable(Design,?= =?UTF-8?q?=20WireInterface,=20WireIn=E2=80=A6=20(#915)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create a common interface for Node and Wire Objects Signed-off-by: Chris Lavin * Refactor WireObject->WireInterface Signed-off-by: Chris Lavin * Adds hashCode() and equals() and Javadocs Signed-off-by: Chris Lavin * Adds a test Signed-off-by: Chris Lavin * Add missing license header Signed-off-by: Chris Lavin * Add default method for get{Tile,Wire}Name(), remove public Signed-off-by: Eddie Hung * RouteThruHelper.isRouteThruPIPAvailable(Design, WireInterface, WireInterface) Signed-off-by: Eddie Hung --------- Signed-off-by: Chris Lavin Signed-off-by: Eddie Hung Co-authored-by: Chris Lavin --- .../rapidwright/router/RouteThruHelper.java | 44 ++----------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/src/com/xilinx/rapidwright/router/RouteThruHelper.java b/src/com/xilinx/rapidwright/router/RouteThruHelper.java index 3604a271e..77c261167 100644 --- a/src/com/xilinx/rapidwright/router/RouteThruHelper.java +++ b/src/com/xilinx/rapidwright/router/RouteThruHelper.java @@ -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; /** @@ -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;