From f4cdafa6220667f35ee04e440135eb51b93e960c Mon Sep 17 00:00:00 2001 From: Chris Lavin Date: Wed, 18 Dec 2024 17:51:09 -0700 Subject: [PATCH 1/2] Test for SiteInst.isEmpty() Signed-off-by: Chris Lavin --- .../rapidwright/design/TestSiteInst.java | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/test/src/com/xilinx/rapidwright/design/TestSiteInst.java b/test/src/com/xilinx/rapidwright/design/TestSiteInst.java index 69a3dcef4..e2f945f6a 100644 --- a/test/src/com/xilinx/rapidwright/design/TestSiteInst.java +++ b/test/src/com/xilinx/rapidwright/design/TestSiteInst.java @@ -23,6 +23,15 @@ package com.xilinx.rapidwright.design; +import java.nio.file.Path; +import java.util.Arrays; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + import com.xilinx.rapidwright.design.tools.LUTTools; import com.xilinx.rapidwright.device.BEL; import com.xilinx.rapidwright.device.BELPin; @@ -30,14 +39,6 @@ import com.xilinx.rapidwright.device.Series; import com.xilinx.rapidwright.support.RapidWrightDCP; import com.xilinx.rapidwright.util.VivadoToolsHelper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - -import java.nio.file.Path; -import java.util.Arrays; public class TestSiteInst { @@ -401,4 +402,15 @@ public void testSiteRouting(@TempDir Path dir) { design.routeSites(); VivadoToolsHelper.assertRoutedSuccessfullyByVivado(design, dir); } + + @Test + public void testIsEmpty() { + Design d = RapidWrightDCP.loadDCP("picoblaze_2022.2.dcp"); + for (SiteInst si : d.getSiteInsts()) { + Assertions.assertFalse(si.isEmpty()); + } + + SiteInst si = d.createSiteInst(d.getDevice().getSite("SLICE_X40Y10")); + Assertions.assertTrue(si.isEmpty()); + } } From cf5690cad5b0d7a7ec4eaf9850f6e68b2c965406 Mon Sep 17 00:00:00 2001 From: Chris Lavin Date: Fri, 3 Jan 2025 20:19:24 -0700 Subject: [PATCH 2/2] Restore import order Signed-off-by: Chris Lavin --- .../xilinx/rapidwright/design/TestSiteInst.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/src/com/xilinx/rapidwright/design/TestSiteInst.java b/test/src/com/xilinx/rapidwright/design/TestSiteInst.java index e2f945f6a..2829a4865 100644 --- a/test/src/com/xilinx/rapidwright/design/TestSiteInst.java +++ b/test/src/com/xilinx/rapidwright/design/TestSiteInst.java @@ -23,15 +23,6 @@ package com.xilinx.rapidwright.design; -import java.nio.file.Path; -import java.util.Arrays; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - import com.xilinx.rapidwright.design.tools.LUTTools; import com.xilinx.rapidwright.device.BEL; import com.xilinx.rapidwright.device.BELPin; @@ -39,6 +30,14 @@ import com.xilinx.rapidwright.device.Series; import com.xilinx.rapidwright.support.RapidWrightDCP; import com.xilinx.rapidwright.util.VivadoToolsHelper; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.nio.file.Path; +import java.util.Arrays; public class TestSiteInst {