Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PhysNetlistWriter] Recognize static source BELPins (e.g. LUT outputs) #923

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/com/xilinx/rapidwright/interchange/PhysNetlistWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,21 @@ public static void extractIntraSiteRouting(Net net, List<RouteBranchNode> nodes,
} else {
if (bel.getBELClass() == BELClass.BEL) {
if (cell == null) {
// Skip if nothing placed here
continue;
}
if (!net.isStaticNet()) {
// Skip if nothing placed here and not driving a static net
continue;
}
assert(bel.isLUT() || // LUTs can be a GND or VCC source
(net.isGNDNet() && bel.isGndSource()) ||
(net.isVCCNet() && bel.isVccSource()));
} else {
if (cell.getType().equals(PORT)) {
continue;
}

if (cell.getType().equals(PORT)) {
continue;
routethru = cell.isRoutethru();
}

routethru = cell.isRoutethru();

// Fall through
} else if (bel.getBELClass() == BELClass.RBEL) {
if (siteInst.getUsedSitePIP(belPin) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.xilinx.rapidwright.design.DesignTools;
import com.xilinx.rapidwright.design.SiteInst;
import com.xilinx.rapidwright.design.tools.LUTTools;
import com.xilinx.rapidwright.design.tools.TestLUTTools;
import com.xilinx.rapidwright.device.BEL;
import com.xilinx.rapidwright.device.BELPin;
import com.xilinx.rapidwright.interchange.PhysicalNetlist.PhysNetlist;
Expand All @@ -48,7 +47,6 @@
import com.xilinx.rapidwright.rwroute.TestRWRoute;
import com.xilinx.rapidwright.support.LargeTest;
import com.xilinx.rapidwright.support.RapidWrightDCP;
import com.xilinx.rapidwright.util.Utils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
Expand Down Expand Up @@ -340,4 +338,19 @@ public void testSimulateSwappedLutPinsWithRWRoute(String path, @TempDir Path tem
System.setProperty("rapidwright.physNetlistWriter.simulateSwappedLutPins", "false");
}
}

@Test
public void testStaticSourceBELPin(@TempDir Path tempDir) throws IOException {
Design inputDesign = RapidWrightDCP.loadDCP("picoblaze_ooc_X10Y235.dcp");
Assertions.assertEquals(inputDesign.getGndNet(),
inputDesign.getSiteInst("SLICE_X15Y239").getNetFromSiteWire("A_O"));

String interchangePath = tempDir.resolve("design.phys").toString();
PhysNetlistWriter.writePhysNetlist(inputDesign, interchangePath);

Design outputDesign = PhysNetlistReader.readPhysNetlist(interchangePath.toString(), inputDesign.getNetlist());
inputDesign = null;
Assertions.assertEquals(outputDesign.getGndNet(),
outputDesign.getSiteInst("SLICE_X15Y239").getNetFromSiteWire("A_O"));
}
}