Modifier and Type | Field and Description |
---|---|
static EDIFPropertyValue |
DEFAULT_PROP_VALUE |
static byte[] |
EXPORT_CONST_CELLREF |
static byte[] |
EXPORT_CONST_CLOSE_DESIGN |
static byte[] |
EXPORT_CONST_CLOSE_EDIF |
static byte[] |
EXPORT_CONST_CLOSE_NL |
static byte[] |
EXPORT_CONST_CLOSE_REF |
static byte[] |
EXPORT_CONST_COMMENT |
static byte[] |
EXPORT_CONST_DESIGN_START |
static byte[] |
EXPORT_CONST_DOUBLE_CLOSE |
static byte[] |
EXPORT_CONST_EDIF_HEAD |
static byte[] |
EXPORT_CONST_EDIF_VERSION |
static byte[] |
EXPORT_CONST_LIBRARYREF |
static byte[] |
EXPORT_CONST_META_X |
static byte[] |
EXPORT_CONST_PROGRAM |
static byte[] |
EXPORT_CONST_PROP_INDENT |
static byte[] |
EXPORT_CONST_QUOTE_CLOSE_NL |
static String |
IOSTANDARD_PROP |
static Map<Series,Map<String,Pair<String,EnumSet<IOStandard>>>> |
macroCollapseExceptionMap
Reverse map that stores macro to prim collapse conditional based on IOStandards
(Macro to Prim (if set IOStandard is in set))
|
static Map<Series,Map<String,Pair<String,EnumSet<IOStandard>>>> |
macroExpandExceptionMap
Map that stores prim to macro expansions conditional based on IOStandards
(Start Prim to End Macro (if set IOStandard is in set))
|
static String |
READ_EDIF_CMD |
EXPORT_CONST_RENAME_START
Constructor and Description |
---|
EDIFNetlist(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
addComment(String comment) |
void |
addEncryptedCells(List<String> encryptedCells) |
EDIFLibrary |
addLibrary(EDIFLibrary library)
Adds the library to this netlist.
|
EDIFPropertyValue |
addMetax(String key,
EDIFPropertyValue value) |
void |
addTclLoadEncryptedCells(Path tclPath)
Parses a Tcl load script generated by
EDIFTools.writeTclLoadScriptForPartialEncryptedDesigns(EDIFNetlist, Path, String) . |
void |
addTrackingChange(EDIFCell cell,
EDIFChange change) |
void |
changeTopName(String newName)
Will change the netlist name and top cell and instance name.
|
void |
collapseMacroUnisims(Series series)
Collapses any macro primitives back into their primitive state.
|
void |
consolidateAllToWorkLibrary()
Migrates all libraries except HDI primitives and work to
the work library.
|
void |
copyCellAndSubCells(EDIFCell cell)
This copies the cell and all of its descendants into this netlist.
|
EDIFLibrary |
copyLibraryAndSubCells(EDIFLibrary library)
This copies the library and all of its cells into this netlist.
|
void |
expandMacroUnisims(Series series)
Expands macro primitives into a native-compatible implementation.
|
void |
exportEDIF(OutputStream out) |
void |
exportEDIF(OutputStream out,
boolean stable) |
void |
exportEDIF(Path fileName) |
void |
exportEDIF(Path fileName,
boolean stable) |
void |
exportEDIF(String fileName) |
List<EDIFHierCellInst> |
findCellInsts(String wildcardPattern)
Searches all EDIFCellInst objects to find those with matching names
against the wildcard pattern.
|
void |
generateBuildComments()
Adds date and username build comments such as:
(comment "Built on 'Mon May 1 15:17:36 PDT 2017'")
(comment "Built by 'clavin'")
|
HashMap<String,EDIFCellInst> |
generateCellInstMap()
Identify primitive cell instances in EDIF netlist
|
HashMap<String,EDIFNet> |
generateEDIFNetMap(HashMap<String,EDIFCellInst> cellInstMap) |
List<EDIFHierCellInst> |
getAllDescendants(String instanceName,
String wildcardPattern,
boolean leavesOnly)
Searches all lower levels of hierarchy to find descendants.
|
List<EDIFCellInst> |
getAllLeafCellInstances()
Traverses the netlist and produces a list of all primitive leaf cell instances.
|
List<EDIFHierCellInst> |
getAllLeafDescendants(EDIFHierCellInst instance)
Searches all lower levels of hierarchy to find all leaf descendants.
|
List<EDIFHierCellInst> |
getAllLeafDescendants(EDIFHierCellInst instance,
boolean includeBlackBoxes)
Searches all lower levels of hierarchy to find all leaf descendants.
|
List<EDIFHierCellInst> |
getAllLeafDescendants(String instanceName)
Searches all lower levels of hierarchy to find all leaf descendants.
|
List<EDIFHierCellInst> |
getAllLeafDescendants(String instanceName,
String wildcardPattern) |
List<EDIFHierCellInst> |
getAllLeafHierCellInstances()
Traverses the netlist and produces a list of all primitive leaf hierarchical
cell instances.
|
List<EDIFHierCellInst> |
getAllLeafHierCellInstances(boolean includeBlackBoxes)
Traverses the netlist and produces a list of all primitive leaf hierarchical
cell instances.
|
EDIFCell |
getCell(String legalEdifName)
Iterates through libraries to find first cell with matching name and
returns it.
|
EDIFCellInst |
getCellInstFromHierName(String name)
Based on a hierarchical string, this method will get the instance corresponding
to the name provided.
|
List<String> |
getComments() |
EDIFDesign |
getDesign() |
Device |
getDevice() |
List<String> |
getEncryptedCells()
Gets the list of EDN filenames that were present in the original directory where the EDIF
file was loaded from.
|
EDIFCell |
getHDIPrimitive(Unisim unisim)
Will create or get the specified unisim cell and ensure it is added to the HDI
primitives library.
|
EDIFLibrary |
getHDIPrimitivesLibrary() |
EDIFHierCellInst |
getHierCellInstFromName(String name)
Creates a new hierarchical cell instance reference from the provided hierarchical cell
instance name
|
EDIFHierNet |
getHierNetFromName(String netName)
Gets the hierarchical net from the netname provided.
|
Pair<List<EDIFCellInst>,String> |
getHierObject(String name)
Resolve as much of a hierarchical name as possible to a List of EDIFCellInsts, suitable for creating a EDIFHierCellInst from.
|
EDIFHierPortInst |
getHierPortInstFromName(String hierPortInstName)
Gets the hierarchical port instance object from the full name.
|
Collection<EDIFPropertyValue> |
getIOStandards(EDIFCellInst eci)
Helper method to get the set of IOStandard properties of an EDIFCellInst;
should one not exist, fallback to the IOStandard property on
the EDIFNet object(s) connected to the top-level output port(s) that it drives.
|
Collection<EDIFLibrary> |
getLibraries() |
List<EDIFLibrary> |
getLibrariesInExportOrder()
Get Libraries in export order so that any cell instance appearing in a library will only
refer to cells in its own library or previous libraries in the list.
|
Map<String,EDIFLibrary> |
getLibrariesMap() |
EDIFLibrary |
getLibrary(String name) |
Map<EDIFCell,List<EDIFChange>> |
getModifiedCells() |
List<EDIFHierNet> |
getNetAliases(EDIFHierNet initialNet)
Get's all equivalent nets in the netlist from the provided net name.
|
EDIFNet |
getNetFromHierName(String netName)
Based on a hierarchical string name, this method gets and returns the net inside
the instance.
|
String |
getOrigDirectory()
Keeps track of the original source directory from where this EDIF file was loaded.
|
EDIFHierNet |
getParentNet(EDIFHierNet netAlias)
Gets the canonical net for this net name.
|
Map<EDIFHierNet,EDIFHierNet> |
getParentNetMap()
Gets the map of all canonical net for every net alias.
|
Map<String,String> |
getParentNetMapNames()
Gets the map of all canonical net for every net alias.
|
String |
getParentNetName(String netAlias)
Gets the canonical net for this net name.
|
List<EDIFHierPortInst> |
getPhysicalGndPins()
Get all Physical ground pins
|
Net |
getPhysicalNetFromPin(EDIFHierPortInst p,
Design d) |
Net |
getPhysicalNetFromPin(String parentHierInstName,
EDIFPortInst p,
Design d) |
Map<EDIFHierNet,List<EDIFHierPortInst>> |
getPhysicalNetPinMap()
Get the physical pins all parent nets (as returned by
EDIFNetlist.getParentNet(EDIFHierNet) ). |
List<EDIFHierPortInst> |
getPhysicalPins(EDIFHierNet parentNet)
Get the physical pins of this net.
|
List<EDIFHierPortInst> |
getPhysicalPins(Net net)
For a given physical net, get all physical pins from the EDIF.
|
List<EDIFHierPortInst> |
getPhysicalPins(String parentNetName)
Get all physical pins of a net.
|
List<EDIFHierPortInst> |
getPhysicalVccPins()
Get all Physical vcc pins
|
List<EDIFHierPortInst> |
getSinksFromNet(EDIFHierNet net)
Gets all the primitive pin sinks that are strict descendants of
this provided net.
|
EDIFCell |
getTopCell() |
EDIFCellInst |
getTopCellInst() |
EDIFHierCellInst |
getTopHierCellInst() |
static List<EDIFCell> |
getValidCellExportOrder(Set<EDIFCell> cells,
boolean stable)
Creates an ordered list of cells such that each cell that appears
in the list only references cells that have already been seen in
the list.
|
EDIFLibrary |
getWorkLibrary() |
static NetType |
identifyNetType(EDIFHierPortInst source) |
boolean |
isTrackingCellChanges()
Checks a flag indicating if this netlist is currently tracking changes to its EDIFCells.
|
static void |
main(String[] args) |
void |
migrateCellAndSubCells(EDIFCell cell)
This moves the cell and all of its descendants into this netlist.
|
void |
migrateCellAndSubCells(EDIFCell cell,
boolean uniqueifyCollisions) |
void |
migrateToWorkLibrary(String library)
Migrates all cells in the provided library
into the standard work library.
|
static EDIFNetlist |
readBinaryEDIF(Path path) |
static EDIFNetlist |
readBinaryEDIF(String fileName) |
EDIFLibrary |
removeLibrary(String name) |
void |
removeUnusedCellsFromAllWorkLibraries()
Removals all unused cells from a netlist from any work library (all except hdi_primitives)
|
void |
removeUnusedCellsFromWorkLibrary() |
void |
renameNetlistAndTopCell(String newName) |
void |
resetCellInstIOStandardFallbackMap()
Reset the fallback map used by
EDIFNetlist.getIOStandards(com.xilinx.rapidwright.edif.EDIFCellInst) so that it may be
re-initialized upon next use. |
void |
resetParentNetMap()
Resets the internal parent net map of the netlist.
|
void |
setDesign(EDIFDesign design) |
void |
setDevice(Device device) |
void |
setEncryptedCells(List<String> encryptedCells) |
void |
setTrackCellChanges(boolean trackCellChanges)
Flag to track changes to EDIFCell changes to this netlist.
|
void |
trackChange(EDIFCell cell,
EDIFChangeType type,
String objectName) |
void |
writeBinaryEDIF(OutputStream os) |
void |
writeBinaryEDIF(Path path) |
void |
writeBinaryEDIF(String fileName) |
compareTo, equals, exportEDIFName, exportSomeEDIFName, getName, getNewMap, hashCode, toString
public static final Map<Series,Map<String,Pair<String,EnumSet<IOStandard>>>> macroExpandExceptionMap
public static final Map<Series,Map<String,Pair<String,EnumSet<IOStandard>>>> macroCollapseExceptionMap
public static final String IOSTANDARD_PROP
public static final EDIFPropertyValue DEFAULT_PROP_VALUE
public static final byte[] EXPORT_CONST_EDIF_VERSION
public static final byte[] EXPORT_CONST_EDIF_HEAD
public static final byte[] EXPORT_CONST_PROGRAM
public static final byte[] EXPORT_CONST_CLOSE_NL
public static final byte[] EXPORT_CONST_QUOTE_CLOSE_NL
public static final byte[] EXPORT_CONST_COMMENT
public static final byte[] EXPORT_CONST_META_X
public static final byte[] EXPORT_CONST_DOUBLE_CLOSE
public static final byte[] EXPORT_CONST_DESIGN_START
public static final byte[] EXPORT_CONST_CELLREF
public static final byte[] EXPORT_CONST_LIBRARYREF
public static final byte[] EXPORT_CONST_CLOSE_REF
public static final byte[] EXPORT_CONST_PROP_INDENT
public static final byte[] EXPORT_CONST_CLOSE_DESIGN
public static final byte[] EXPORT_CONST_CLOSE_EDIF
public static final String READ_EDIF_CMD
public static List<EDIFCell> getValidCellExportOrder(Set<EDIFCell> cells, boolean stable)
cells
- A set of cells to consider.stable
- makes sure that the list is always the same for the same inputpublic void generateBuildComments()
public EDIFLibrary addLibrary(EDIFLibrary library)
library
- The library to add.public EDIFLibrary getLibrary(String name)
public EDIFLibrary getHDIPrimitivesLibrary()
public EDIFCell getHDIPrimitive(Unisim unisim)
unisim
- The desired Unisim cell type.public EDIFLibrary getWorkLibrary()
public EDIFLibrary removeLibrary(String name)
public void renameNetlistAndTopCell(String newName)
public void removeUnusedCellsFromAllWorkLibraries()
public void removeUnusedCellsFromWorkLibrary()
public EDIFCell getCell(String legalEdifName)
legalEdifName
- The legal EDIF name of the cell to find.public EDIFDesign getDesign()
public void setDesign(EDIFDesign design)
design
- the design to setpublic Device getDevice()
public void setDevice(Device device)
public EDIFCell getTopCell()
public EDIFCellInst getTopCellInst()
public EDIFHierCellInst getTopHierCellInst()
public boolean addComment(String comment)
public EDIFPropertyValue addMetax(String key, EDIFPropertyValue value)
public List<String> getComments()
public void migrateToWorkLibrary(String library)
library
- The library with cells to be migrated to work.public void consolidateAllToWorkLibrary()
public void migrateCellAndSubCells(EDIFCell cell)
cell
- The cell (and all its descendants) to move into this netlist's librariespublic void migrateCellAndSubCells(EDIFCell cell, boolean uniqueifyCollisions)
public void copyCellAndSubCells(EDIFCell cell)
cell
- The cell (and all its descendants) to copy into this netlist's librariespublic EDIFLibrary copyLibraryAndSubCells(EDIFLibrary library)
library
- The library (and all its cells) to copy into this netlist's librariespublic void changeTopName(String newName)
newName
- New name for the netlistpublic Map<String,EDIFLibrary> getLibrariesMap()
public Collection<EDIFLibrary> getLibraries()
public List<EDIFLibrary> getLibrariesInExportOrder()
public void exportEDIF(OutputStream out, boolean stable) throws IOException
IOException
public void exportEDIF(OutputStream out) throws IOException
IOException
public void exportEDIF(Path fileName, boolean stable)
public void exportEDIF(Path fileName)
public void exportEDIF(String fileName)
public EDIFCellInst getCellInstFromHierName(String name)
EDIFNetlist.getHierCellInstFromName(String)
instead.name
- Hierarchical name of the instance, for example: 'clk_wiz/inst/bufg0'public EDIFNet getNetFromHierName(String netName)
netName
- The hierarchical name of the net to get, for example: 'inst0/inst1/inst2/net0'public EDIFHierPortInst getHierPortInstFromName(String hierPortInstName)
hierPortInstName
- Full hierarchical name of the port instance.public Pair<List<EDIFCellInst>,String> getHierObject(String name)
name
- the hierarchical namepublic EDIFHierCellInst getHierCellInstFromName(String name)
name
- Full hierarchical cell instance namepublic EDIFHierNet getHierNetFromName(String netName)
EDIFHierNet
.netName
- Full hierarchical name of the net to retrieve.public Net getPhysicalNetFromPin(String parentHierInstName, EDIFPortInst p, Design d)
public Net getPhysicalNetFromPin(EDIFHierPortInst p, Design d)
public List<EDIFHierCellInst> findCellInsts(String wildcardPattern)
wildcardPattern
- Search pattern that includes alphanumeric and wildcards (*).public List<EDIFHierCellInst> getAllLeafDescendants(String instanceName)
instanceName
- Name of the instance to start searching from.public List<EDIFHierCellInst> getAllLeafDescendants(EDIFHierCellInst instance)
instance
- The instance to start searching from.public List<EDIFHierCellInst> getAllLeafDescendants(EDIFHierCellInst instance, boolean includeBlackBoxes)
instance
- The instance to start searching from.includeBlackBoxes
- Flag, if set to true, will include black box
instances in the returned list.public List<EDIFHierCellInst> getAllLeafDescendants(String instanceName, String wildcardPattern)
public List<EDIFHierCellInst> getAllDescendants(String instanceName, String wildcardPattern, boolean leavesOnly)
instanceName
- Name of the instance to start searching from.wildcardPattern
- if non-null, filters results by matching wildcard patternleavesOnly
- Flag indicating if only leaf cells should be includedpublic static NetType identifyNetType(EDIFHierPortInst source)
public List<EDIFHierNet> getNetAliases(EDIFHierNet initialNet)
initialNet
- Full hierarchical netname to use as a starting point in the search.public String getParentNetName(String netAlias)
netAlias
- An absolute net name alias (from logical netlist)public EDIFHierNet getParentNet(EDIFHierNet netAlias)
netAlias
- An absolute net name alias (from logical netlist)public Map<EDIFHierNet,EDIFHierNet> getParentNetMap()
public Map<String,String> getParentNetMapNames()
EDIFNetlist.getParentNetMap()
, but converted to Strings.public void resetParentNetMap()
public List<EDIFCellInst> getAllLeafCellInstances()
public List<EDIFHierCellInst> getAllLeafHierCellInstances(boolean includeBlackBoxes)
includeBlackBoxes
- Flag if set to true will also include black boxes in
the returned list.public List<EDIFHierCellInst> getAllLeafHierCellInstances()
public Map<EDIFHierNet,List<EDIFHierPortInst>> getPhysicalNetPinMap()
EDIFNetlist.getParentNet(EDIFHierNet)
).
No special handling for static nets is performed. Therefore, only the local connectivity is visible. To see
all globally connected static pins, use EDIFNetlist.getPhysicalVccPins()
and EDIFNetlist.getPhysicalGndPins()
.public List<EDIFHierPortInst> getPhysicalVccPins()
public List<EDIFHierPortInst> getPhysicalGndPins()
public List<EDIFHierPortInst> getPhysicalPins(EDIFHierNet parentNet)
EDIFNetlist.getPhysicalVccPins()
and EDIFNetlist.getPhysicalGndPins()
.parentNet
- the parent net, as returned by EDIFNetlist.getParentNet(EDIFHierNet)
public List<EDIFHierPortInst> getPhysicalPins(String parentNetName)
EDIFNetlist.getPhysicalPins(Net)
instead.parentNetName
- the net name, as returned by EDIFNetlist.getParentNet(EDIFHierNet)
public List<EDIFHierPortInst> getPhysicalPins(Net net)
EDIFNetlist.getPhysicalPins(String)
with the net's name, but this function is faster.net
- the physical netpublic List<EDIFHierPortInst> getSinksFromNet(EDIFHierNet net)
net
- The net to trace to its sinks.public HashMap<String,EDIFNet> generateEDIFNetMap(HashMap<String,EDIFCellInst> cellInstMap)
cellInstMap
- public HashMap<String,EDIFCellInst> generateCellInstMap()
public void expandMacroUnisims(Series series)
IBUF => IBUF (IBUFCTRL, IBUF)
for
UltraScale devices.series
- The architecture series targeted by this netlist.public void collapseMacroUnisims(Series series)
EDIFNetlist.expandMacroUnisims(Series)
.series
- The architecture series targeted by this netlist.public String getOrigDirectory()
public List<String> getEncryptedCells()
public void setEncryptedCells(List<String> encryptedCells)
public void addEncryptedCells(List<String> encryptedCells)
public void addTclLoadEncryptedCells(Path tclPath)
EDIFTools.writeTclLoadScriptForPartialEncryptedDesigns(EDIFNetlist, Path, String)
.
and appends them to this netlist (useful for when merging designs).tclPath
- Path to the existing Tcl load script for the accompanying DCP filepublic static EDIFNetlist readBinaryEDIF(Path path)
public static EDIFNetlist readBinaryEDIF(String fileName)
public void writeBinaryEDIF(Path path)
public void writeBinaryEDIF(OutputStream os)
public void writeBinaryEDIF(String fileName)
public boolean isTrackingCellChanges()
EDIFNetlist.getModifiedCells()
.
EDIFCells are determined as modified if one of the following is true:
(1) A port was removed, added or modified
(2) A net was removed, added or modified
(3) An instance was removed, added or modifiedpublic void setTrackCellChanges(boolean trackCellChanges)
EDIFNetlist.isTrackingCellChanges()
trackCellChanges
- True to enable tracking of EDIFCells, false to stop trackingpublic void trackChange(EDIFCell cell, EDIFChangeType type, String objectName)
public void addTrackingChange(EDIFCell cell, EDIFChange change)
public Map<EDIFCell,List<EDIFChange>> getModifiedCells()
public Collection<EDIFPropertyValue> getIOStandards(EDIFCellInst eci)
EDIFNetlist.cellInstIOStandardFallback
to speed up future queries.
This map will not be updated upon connecting a new EDIFNet nor
if a new property was added to the existing EDIFNet --- for this
map to be re-initialized use EDIFNetlist.resetCellInstIOStandardFallbackMap()
.eci
- EDIFCellInst object.public void resetCellInstIOStandardFallbackMap()
EDIFNetlist.getIOStandards(com.xilinx.rapidwright.edif.EDIFCellInst)
so that it may be
re-initialized upon next use.public static void main(String[] args) throws FileNotFoundException
FileNotFoundException