Skip to content

Commit

Permalink
Update to allow for Modules with null anchors (for modules without an…
Browse files Browse the repository at this point in the history
…y logic inside).
  • Loading branch information
clavin-xlnx committed Oct 25, 2018
1 parent 035372c commit bc1015d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions com/xilinx/rapidwright/design/ModuleInst.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public boolean isPlaced(){
*/
public ArrayList<Site> getAllValidPlacements(){
ArrayList<Site> validSites = new ArrayList<Site>();
if(getAnchor() == null) return validSites;
Site originalSite = getAnchor().getSite();
Design design = getDesign();
Site[] sites = design.getDevice().getAllCompatibleSites(getAnchor().getSiteTypeEnum());
Expand Down Expand Up @@ -251,6 +252,7 @@ public boolean place(Site newAnchorSite){
Device dev = newAnchorSite.getDevice();

// Do some error checking on the newAnchorSite
if(module.getAnchor() == null) return false;
Site p = module.getAnchor().getSite();
Tile t = newAnchorSite.getTile();
Site newValidSite = p.getCorrespondingSite(module.getAnchor().getSiteTypeEnum(), t);
Expand Down Expand Up @@ -449,7 +451,10 @@ public Site getLowerLeftPlacement(){
*/
public Site getLowerLeftPlacement(SiteTypeEnum type){
// Calculate anchor offset
Tile origAnchor = getModule().getAnchor().getSite().getTile();
SiteInst anchor = getModule().getAnchor();
if(anchor == null) return null;

Tile origAnchor = anchor.getSite().getTile();
Tile currAnchor = getAnchor().getSite().getTile();
int dx = currAnchor.getTileXCoordinate() - origAnchor.getTileXCoordinate();
int dy = currAnchor.getTileYCoordinate() - origAnchor.getTileYCoordinate();
Expand Down Expand Up @@ -532,7 +537,10 @@ public boolean placeMINearTile(Tile ipTile, SiteTypeEnum type){

Tile newAnchorTile = getModule().getCorrespondingAnchorTile(targetTile, ipTile, dev);
if(newAnchorTile == null) return false;
Site moduleAnchor = getModule().getAnchor().getSite();

SiteInst anchor = getModule().getAnchor();
if(anchor == null) return false;
Site moduleAnchor = anchor.getSite();
boolean success = place(newAnchorTile.getSites()[moduleAnchor.getTile().getSiteIndex(moduleAnchor)]);

if(!success) System.out.println("Failed placement attempt, TargetTile="+targetTile.getName()+" ipTile="+ipTile.getName());
Expand Down
2 changes: 2 additions & 0 deletions com/xilinx/rapidwright/ipi/BlockStitcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ public static void main(String[] args) {
stitched.writeCheckpoint(args[1].replace(".edf","_placed.dcp"));
t.stop();
t.printSummary();
if(OPEN_HAND_PLACER) HandPlacer.openDesign(stitched);
return;
}else{
BlockPlacer2 placer = new BlockPlacer2();
Expand All @@ -683,6 +684,7 @@ public static void main(String[] args) {

for(ModuleInst mi : miMap.keySet()){
if(mi.getModule().getPBlock() == null) continue;
if(mi.getModule().getAnchor() == null) continue;
String cacheID = mi.getModule().getMetaDataMap().get(CACHE_ID);
BlockGuide bg = ig.getBlock(cacheID);

Expand Down

0 comments on commit bc1015d

Please sign in to comment.