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

[TestDesign] Add testPlaceCellPinMappings() #1122

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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));
}
}
}
Loading