* Extract the part information from the bitstream. If it is not available in the bitstream,
* extract it from the command line options.
*/
public XilinxConfigurationSpecification getPartInfoExitOnError(OptionSet options, Bitstream bitstream, boolean printMessage) {
XilinxConfigurationSpecification partInfo = null;
// first see if the part can be found from the bitstream
String partName = null;
if (bitstream != null && bitstream.getHeader() != null) {
partName = bitstream.getHeader().getPartName();
// strip the package name from the original part name
partName = DeviceLookup.getRootDeviceName(partName);
}
if (options.has(PART_OPTION)) {
// Assume that this is a root part name
String cmdPartName = (String) options.valueOf(PART_OPTION);
partName = cmdPartName;
}
partInfo = DeviceLookup.lookupPartV4V5V6(partName);
if (partInfo == null) {
System.err.println("Invalid Part Name:"+partName);
DeviceLookup.printAvailableParts(System.err);
System.exit(1);
}
if (printMessage)
System.out.println("Part:"+partInfo.getDeviceName());
return partInfo;
}