Skip to content

Commit

Permalink
[TestDesign] Add testPlaceCellPinMappings()
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx committed Dec 5, 2024
1 parent 3e4ae38 commit f76bdba
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/src/com/xilinx/rapidwright/design/TestDesign.java
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,36 @@ public void testNetOrder(String dcpFileName) {
Assertions.assertTrue(Arrays.equals(nets1, nets2));
}
}

@Test
public void testPlaceCellPinMappings() {
final EDIFNetlist netlist = TestEDIF.createEmptyNetlist();
final Design design = new Design(netlist);

final Cell myCell = design.createCell("myCell", Unisim.FDRE);
Assertions.assertTrue(myCell.getPinMappingsL2P().isEmpty());

final Site site = design.getDevice().getSite(SITE);
design.createSiteInst(site);
BEL bel = site.getBEL("AFF");
Assertions.assertNotNull(bel);
design.placeCell(myCell, site, bel);

// Check that L2P and P2L are consistent
for (String logPin : new String[]{"CE", "C", "D", "R", "Q"}) {
String physPin = myCell.getPhysicalPinMapping(logPin);
Assertions.assertEquals(logPin, myCell.getLogicalPinMapping(physPin));
}

// Move the Cell to another BEL
myCell.unplace();
bel = site.getBEL("BFF");
design.placeCell(myCell, site, bel);

// Check that L2P and P2L remain consistent
for (String logPin : new String[]{"CE", "C", "D", "R", "Q"}) {
String physPin = myCell.getPhysicalPinMapping(logPin);
Assertions.assertEquals(logPin, myCell.getLogicalPinMapping(physPin));
}
}
}

0 comments on commit f76bdba

Please sign in to comment.