Skip to content

Commit

Permalink
Fix 748 - Updates RAM32X1S property to correct default (#751)
Browse files Browse the repository at this point in the history
* Fix 748 - Updates RAM32X1S property to correct default

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

* Extend test to RAM32X1S_1 as well as RAM16X1S*

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

* Change to canary for unsupported macros

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

---------

Signed-off-by: Chris Lavin <[email protected]>
Signed-off-by: Eddie Hung <[email protected]>
Co-authored-by: Eddie Hung <[email protected]>
  • Loading branch information
clavin-xlnx and eddieh-xlnx authored Jul 21, 2023
1 parent 4a50007 commit 1b6e1a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/xilinx/rapidwright/util/DataVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,6 @@ public class DataVersions {
dataVersionMap.put("data/devices/zynquplusrfsoc/xqzu49dr_db.dat", new Pair<>("xqzu49dr-db-dat", "ff145122f2caea588120ac4da439d838"));
dataVersionMap.put("data/partdump.csv", new Pair<>("partdump-csv", "f5aa2d4c08196e330576bda0e644772a"));
dataVersionMap.put("data/parts.db", new Pair<>("parts-db", "f5d8a26178d35bd1a68c441b37a04279"));
dataVersionMap.put("data/unisim_data.dat", new Pair<>("unisim-data-dat", "ce8410650ad739c8630b12c3152693a3"));
dataVersionMap.put("data/unisim_data.dat", new Pair<>("unisim-data-dat", "85322379ad298d5a710d24a731d151e8"));
}
}
41 changes: 41 additions & 0 deletions test/src/com/xilinx/rapidwright/edif/TestEDIFNetlist.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,45 @@ public void testMultiLevelMacroExpansion() {
Assertions.assertEquals(childInst.getCellType().getName(), "OBUFTDS_DCIEN_DUAL_BUF");
Assertions.assertEquals(childInst.getCellType().getCellInsts().size(), 3);
}

@ParameterizedTest
@CsvSource({
"RAM32X1S,1'b0",
})
public void testRAM32X1SExpansion(String unisim, String expected) {
EDIFNetlist n = EDIFTools.createNewNetlist("test");

EDIFCell macro = n.getHDIPrimitivesLibrary().addCell(Design.getUnisimCell(Unisim.valueOf(unisim)));
n.getTopCell().createChildCellInst("inst", macro);

Assertions.assertNull(n.getCellInstFromHierName("inst/SP"));

n.expandMacroUnisims(Series.Series7);
EDIFCellInst inst = n.getCellInstFromHierName("inst/SP");
Assertions.assertNotNull(inst);
Assertions.assertEquals(expected, inst.getProperty("IS_CLK_INVERTED").getValue());
}

@ParameterizedTest
@CsvSource({
"RAM32X1S_1",
"RAM16X1S",
"RAM16X1S_1",
})
public void testUnsupportedMacroExpansionAndProperty(String unisim) {
EDIFNetlist n = EDIFTools.createNewNetlist("test");

EDIFCell macro = n.getHDIPrimitivesLibrary().addCell(Design.getUnisimCell(Unisim.valueOf(unisim)));
EDIFCellInst inst = n.getTopCell().createChildCellInst("inst", macro);

Assertions.assertEquals(0, inst.getCellType().getCellInsts().size());

n.expandMacroUnisims(Series.Series7);

// Assert no expansion/retargeting occurred for unsupported macros
Assertions.assertEquals(0, inst.getCellType().getCellInsts().size());

// Assert no property exists on unsupported macros either
Assertions.assertNull(inst.getProperty("IS_CLK_INVERTED"));
}
}

0 comments on commit 1b6e1a7

Please sign in to comment.