public static void main(String[] args){
if(args.length != 1){
MessageGenerator.briefMessageAndExit("USAGE: <input.xdl>");
}
Design design = new Design();
design.loadXDLFile(args[0]);
// Check for unique placement of primitives
MessageGenerator.printHeader("CHECKING FOR UNIQUE PRIMITIVE PLACEMENTS ... ");
HashMap<PrimitiveSite, Instance> usedSites = new HashMap<PrimitiveSite, Instance>();
for(Instance inst : design.getInstances()){
if(inst.getPrimitiveSite() == null){
System.out.println("Warning: " + inst.getName() +" is unplaced.");
}
else if(usedSites.containsKey(inst.getPrimitiveSite())){
System.out.println("ERROR: Placement conflict at site: " + inst.getPrimitiveSiteName() +" (tile: "+inst.getTile()+")");
System.out.println(" Involving at least these two instances:");
System.out.println(" " + inst.getName());
System.out.println(" " + usedSites.get(inst.getPrimitiveSite()).getName());
}
else{
usedSites.put(inst.getPrimitiveSite(), inst);
}
}
// Check for duplicate PIPs
HashMap<PIP,Net> pipMap = new HashMap<PIP, Net>();
MessageGenerator.printHeader("CHECKING FOR DUPLICATE PIPS ... ");
for(Net net : design.getNets()){
for(PIP pip : net.getPIPs()){
Net tmp = pipMap.get(pip);
if(tmp == null){
pipMap.put(pip, net);
}
else{
System.out.print(" Duplicate PIP: " + pip.toString(design.getWireEnumerator()));
System.out.println(" in nets: " + net.getName());
System.out.println(" " + tmp.getName());
}
}
}
// Checking for duplicate PIP sinks
HashMap<Node,Net> pipSinks = new HashMap<Node, Net>();
MessageGenerator.printHeader("CHECKING FOR DUPLICATE PIP SINKS ... ");
for(Net net : design.getNets()){
for(PIP pip : net.getPIPs()){
Node n = new Node(pip.getTile(), pip.getEndWire(), null, 0);
Net tmp = pipSinks.get(n);
if(tmp == null){
pipSinks.put(n, net);
}
else{
System.out.print(" Duplicate PIP Sink: " + n.toString(design.getWireEnumerator()));
System.out.println(" in nets: ");
System.out.println(" " + net.getName());
System.out.println(" " + tmp.getName());
}
}