// Create New Net and static SLICE source with Pin connected to static SLICE
Net newNet = new Net(pin.getInstance().getName() +"_"+ net.getType(), NetType.WIRE);
Instance inst = createStaticSliceSource(net.getType());
placeStaticSlice(inst, true);
Pin newPin = null;
if(design.getExactFamilyName().contains("virtex4")){
newPin = new Pin(true,"Y",inst);
}else if(design.getExactFamilyName().contains("virtex5")){
//TODO V5
newPin = new Pin(true,"D",inst);
}
newNet.replaceSource(newPin);
netsToAdd.add(newNet);
instancesToAdd.add(inst);
Port newPort = new Port(pin.getInstance().getName()+"_outport",newPin);
hardMacro.getPorts().add(newPort);
newPin.setPort(newPort);
}
}
}
else{ // This is just a single IOB
// There should only be 1 pin
Pin pin = pins.get(0);
// Remove IOB
if(isTriState(pin.getInstance())){
failGracefully("Sorry, this design contains tri-state IO. Tri-state IO is not yet supported by the HMG.");
}
instancesToRemove.add(pin.getInstance());
net.getPins().remove(pin);
net.getPIPs().clear();
if(pin.isOutPin()){
// Check if this net drives the BUFG, if so, we don't want to create any ports
// We'll do that with the output of the BUFG
for(Pin p : net.getPins()){
if(p.getInstance().getType().equals(PrimitiveType.BUFG)){
netsToRemove.add(net);
return;
}
}
// CASE 1:
// CASE 2:
// Now create a port, we just choose an arbitrary one if there are more than one
Pin p = net.getPins().get(0);
//XDL_Pin p = pins.get(0); -- This is wrong here because we already removed this pin
Port newPort = new Port(pin.getInstance().getName()+"_inport",p);
hardMacro.addPort(newPort);
p.setPort(newPort);
}
else{
// Check if this is a static net
if(net.isStaticNet()){
if(!net.getSource().getInstance().getType().equals(PrimitiveType.TIEOFF)){
failAndExit("2. This case is unexpected. Talk to Chris about getting it implemented.");
}
instancesToRemove.add(net.getSource().getInstance());
netsToRemove.add(net);
// Create New Net and static SLICE source with Pin connected to static SLICE
Net newNet = new Net(pin.getInstance().getName() + "_" + net.getType(),NetType.WIRE);
Instance inst = createStaticSliceSource(net.getType());
placeStaticSlice(inst, true);
Pin newPin = null;
if(design.getExactFamilyName().contains("virtex4")){
newPin = new Pin(true,"Y",inst);
}else if(design.getExactFamilyName().contains("virtex5")){
//TODO V5
newPin = new Pin(true,"D",inst);
}
newNet.getPins().add(newPin);
newNet.replaceSource(newPin);
netsToAdd.add(newNet);
instancesToAdd.add(inst);
Port newPort = new Port(pin.getInstance().getName()+"_outport",newPin);
hardMacro.getPorts().add(newPort);
newPin.setPort(newPort);
}
else{
// CASE 3:
// CASE 4:
Pin p = net.getSource();
Port newPort = new Port(pin.getInstance().getName()+"_outport",p);
hardMacro.getPorts().add(newPort);
p.setPort(newPort);
}
}
}
}