From b3530744200fe925eef0f927b2afe2044f769358 Mon Sep 17 00:00:00 2001 From: eddieh-xlnx Date: Mon, 16 Oct 2023 09:40:18 -0700 Subject: [PATCH] ReportRouteStatusResult.isFullyRouted() to check >0 logical net found (#852) * Test that invalid input to ReportRouteStatusResult for isFullyRouted() Signed-off-by: Eddie Hung * ReportRouteStatusResult.isFullyRouted() to check at least one logical net found Signed-off-by: Eddie Hung --------- Signed-off-by: Eddie Hung --- .../rapidwright/util/ReportRouteStatusResult.java | 2 +- .../com/xilinx/rapidwright/util/TestVivadoTools.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/com/xilinx/rapidwright/util/ReportRouteStatusResult.java b/src/com/xilinx/rapidwright/util/ReportRouteStatusResult.java index 5cf5de7ef..a0de23aa7 100644 --- a/src/com/xilinx/rapidwright/util/ReportRouteStatusResult.java +++ b/src/com/xilinx/rapidwright/util/ReportRouteStatusResult.java @@ -72,7 +72,7 @@ public ReportRouteStatusResult(List log) { } public boolean isFullyRouted() { - return unroutedNets == 0 && netsWithRoutingErrors == 0; + return logicalNets > 0 && unroutedNets == 0 && netsWithRoutingErrors == 0; } } diff --git a/test/src/com/xilinx/rapidwright/util/TestVivadoTools.java b/test/src/com/xilinx/rapidwright/util/TestVivadoTools.java index dc5c69dd1..cf5c9f6f8 100644 --- a/test/src/com/xilinx/rapidwright/util/TestVivadoTools.java +++ b/test/src/com/xilinx/rapidwright/util/TestVivadoTools.java @@ -34,6 +34,7 @@ import java.nio.file.Files; import java.nio.file.Path; +import java.util.Arrays; import java.util.List; public class TestVivadoTools { @@ -79,6 +80,16 @@ private void assertVivadoLogContains(List log, String query) { Assertions.assertTrue(0 < result.size()); } + @Test + public void testReportRouteStatusInvalid() { + ReportRouteStatusResult rrs = new ReportRouteStatusResult(Arrays.asList( + "foo", + "bar", + "blah" + )); + Assertions.assertFalse(rrs.isFullyRouted()); + } + @Test public void testWriteBitstream(@TempDir Path tempDir) { Assumptions.assumeTrue(FileTools.isVivadoOnPath());