|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbyucc.edif.EdifLibraryManager
Represents a collection of related EdifLibraries. Libraries can be added to this object through merging. When a cell is added, all references to the old cell are replaced with references to the new cell, and all references to the old ports are replaced with references to the new ports. A Cell with the same name can exist in two different libraries, but not in the same library. To Do
EdifLibrary,
Serialized Form| Field Summary | |
private EdifEnvironment |
_edifFile
The EdifEnvironment that points to this library manager. |
private ArrayListNameSpaceResolver |
_libraries
The EdifLibrary objects of this file. |
| Constructor Summary | |
EdifLibraryManager(EdifEnvironment edifFile)
Constructs an EdifLibraryManager Object with the specified EdifEnvironment. |
|
| Method Summary | |
boolean |
addCell(EdifCell cell)
This method will add a Cell to one of the libraries and insure that it is added in the earliest location in the earliest library, and not to a primitive library. |
boolean |
addCell(EdifCell cell,
boolean earliestLib,
boolean earliestPos,
boolean addToPrimitiveLibraryOK)
This method will add a Cell to one of the libraries and insure that it is added to the earliest or latest location, based on earliestLib, and to the earliest or latest library, based on earliestPos. |
private EdifLibrary |
addCellToTargetMergeLibrary(EdifCell cell,
java.util.Map cellMap,
java.lang.String libraryBaseName,
java.util.ArrayList newLibs,
boolean addPrimitivesToPrimitiveLibraries)
Adds the passed-in cell to the appropriate target library for the merge. |
boolean |
addLibrary(EdifLibrary library)
Adds a library to this library manager, and sets its library manager to 'this' |
java.util.Map |
createCellMap(EdifLibrary lib,
boolean checkStructure)
Creates a cell map between cells of this manager to cells of the passed-in library, and bases the equality of cells on the value of checkStructure. |
java.util.Map |
createCellMap(EdifLibraryManager libm,
boolean checkStructure)
Creates a cell map between cells of this manager to cells of the passed-in manager, and bases the equality of cells on the value of checkStructure. |
boolean |
deleteCell(EdifCell cell)
Deletes a cell from the library manager, and returns whether or not the delete was successful. |
boolean |
deleteCell(EdifCell cell,
boolean force)
Deletes a cell from the library manager, and returns whether or not the delete was successful. |
java.util.Collection |
findBlackBoxes()
This method will search through all EdifCells in the current Manager and determine which cells are not defined. |
java.util.Collection |
findCellInstancesOf(EdifCell cell)
This function will return a list of EdifCellInstances in the entire libraryManager that reference the passed in cell. |
EdifLibrary |
findEarliestLibraryToAdd(EdifCell cell)
This method returns the earliest library that this cell can be added to. |
EdifLibrary |
findEarliestLibraryToAdd(EdifCell cell,
boolean addToPrimitiveLibraryOK)
This method returns the earliest library that this cell can be added to. |
int |
findEarliestPositionToAdd(EdifLibrary add)
Returns the earliest position to add the library within the collection of libraries, so as to avoid violating the define before use rule. |
EdifLibrary |
findLatestLibraryToAdd(EdifCell cell)
This method returns the latest library that this cell can be added to. |
EdifLibrary |
findLatestLibraryToAdd(EdifCell cell,
boolean addToPrimitiveLibraryOK)
This method returns the latest library that this cell can be added to. |
int |
findLatestPositionToAdd(EdifLibrary add)
Returns the latest position to add the library within the collection of libraries, so as to avoid violating the define before use rule. |
EdifCell |
findMatchingEdifCell(EdifCell cell)
Overloaded method that defaults to making comparisons not by name only, nor by interface only, nor by structure. |
EdifCell |
findMatchingEdifCell(EdifCell cell,
boolean equalsNameOnly,
boolean equalsStructure,
boolean equalsInterfaceOnly)
Overloaded method that defaults to not making EdifCellInterface compares for possible bus matches. |
EdifCell |
findMatchingEdifCell(EdifCell cell,
boolean equalsNameOnly,
boolean equalsStructure,
boolean equalsInterfaceOnly,
boolean comparePossibleBus)
Returns the first cell in the library manager with it's name equal to the given name. |
java.util.Map |
findMatchingEdifCells(EdifLibraryManager elm)
Overloaded method that defaults to not matching for structure. |
java.util.Map |
findMatchingEdifCells(EdifLibraryManager elm,
boolean equalsStructure)
Overloaded method defaulting to not comparing EdifCellInterface Objects for a possible bus match. |
java.util.Map |
findMatchingEdifCells(EdifLibraryManager elm,
boolean equalsStructure,
boolean comparePossibleBus)
This method will attempt to match all EdifCell objects in the passed in library manager to matching EdifCell objects in this library manager. |
java.util.Map |
findMatchingLibraries(EdifLibraryManager elm,
java.util.Map cellMap)
This method will attempt to make a mapping between libraries in the passed in EdifLibraryManager and this EdifLibraryManager. |
EdifLibrary |
findMatchingLibrary(EdifLibrary inputLibrary,
java.util.Map cellMap)
This method will look at all EdifCell objects found within the same library as the passed-in library and find out which target library matches closest. |
java.util.Collection |
findNonReferencedCells()
This function will return a list of EdifCells that aren't referenced at all within the entire LibraryManager. |
java.util.Collection |
findPortRefsOf(EdifCell cell)
This function will return a list of EdifPortRefs in the entire libraryManager that reference the ports of the passed in cell. |
int |
findPositionToAdd(EdifLibrary add,
boolean earliest)
This method returns the position within the libraries that the passed-in library should be added. |
EdifCell |
getCell(java.lang.String name)
Returns the first cell whose name matches the give String. |
java.util.List |
getCells()
This method will return a List of all cells in the library manager. |
java.util.Collection |
getContainingLibraries(java.lang.String name)
Returns a Collection of Libraries that contain a cell of the specified name. |
EdifEnvironment |
getFile()
Returns the file pointing to this library manager. |
EdifLibrary |
getFirstPrimitiveLibrary()
Returns the first primitive library in the collection of libraries. |
java.util.List |
getLibraries()
Returns the libraries contained by this library manager. |
EdifLibrary |
getLibrary(java.lang.String lib)
Returns the library based on the string lib. |
java.util.Collection |
getNextLibraries(EdifLibrary lib)
Return the Collection of libraries that are defined after the specified library in the libarary manager. |
java.util.Collection |
getPreviousLibraries(EdifLibrary lib)
Return the Collection of libraries that are defined before the specified library in the libarary manager. |
EdifCell |
getTopCell()
Returns the top cell of this design. |
EdifCellInstance |
getTopCellInstance()
Returns the top cell instance of this design. |
boolean |
isValid()
Verify that the Manager is valid (The order of libraries as well as the order of cells within these libraries are OK). |
java.util.Iterator |
iterator()
Returns the libraries contained by this library manager. |
boolean |
merge(EdifLibraryManager elm)
Overloaded method that defaults to: not merging if the top cell in the passed-in library manager exists in this library manager, and to add primitives to primitive libraries. |
boolean |
merge(EdifLibraryManager elm,
boolean mergeIfTopCellNotMatched,
boolean addPrimitivesToPrimitiveLibraries)
Merges the passed-in library manager into this library manager. |
(package private) void |
modifyBusToSinglePorts(EdifPort oldPort,
java.util.Collection newPorts)
Modifies any references from oldPort to the correct EdifPort in newPorts. |
(package private) void |
modifySinglePortsToBus(java.util.Collection oldPorts,
EdifPort newPort)
Modifies any references from oldPorts to newPort. |
boolean |
nameClash(EdifLibrary lib)
Returns true if the library can be added to the library name space, otherwise false. |
void |
pruneNonReferencedCells()
Prunes non referenced cells within the entire library manager. |
void |
renameTopCellToMatchName(java.lang.String filename)
Renames the top cell to match the passed in filename, unless its name already is the name of the filename. |
void |
tagLeafCellsAsPrimitives()
Tags all leaf cells as primitive. |
void |
tagPrimitives(EdifLibrary primitives)
Tags all primitive cells by comparing them to the cells contained within the passed-in library. |
void |
trimToSize()
Trims to size all Trimmable objects in this library manager. |
void |
uniqueify()
Makes unique, every instance in this cell, meaning that a new EdifCell will be copied and added to the same library for each instanced cell that each EdifCell in each library contains. |
private void |
updateCellRefs(EdifCell oldCell,
EdifCell newCell)
Updates all the old information of oldCell to become the information contained in the new cell. |
void |
validateOrder()
Re-orders the libraries, and the cells within into a proper order (if they aren't already). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private ArrayListNameSpaceResolver _libraries
private EdifEnvironment _edifFile
| Constructor Detail |
public EdifLibraryManager(EdifEnvironment edifFile)
edifFile - The EdifEnvironment that contains this
EdifLibraryManager| Method Detail |
public boolean addCell(EdifCell cell,
boolean earliestLib,
boolean earliestPos,
boolean addToPrimitiveLibraryOK)
cell - The cell to add to the library managerearliestLib - Specifies whether to add to the earliest or
latest libraryearliestPos - Specifies whether to add to the earliest or
latest position within the libraryaddToPrimitiveLibraryOK - Specifies whether or not it is
ok to add the cell to a primitive library
EdifLibrary.addCell(EdifCell,boolean)public boolean addCell(EdifCell cell)
cell - The cell to add to the library manager
addCell(EdifCell,boolean,boolean,boolean)
private EdifLibrary addCellToTargetMergeLibrary(EdifCell cell,
java.util.Map cellMap,
java.lang.String libraryBaseName,
java.util.ArrayList newLibs,
boolean addPrimitivesToPrimitiveLibraries)
cell - The cell to be added into this library managercellMap - A mapping between cells that match to eachotherlibraryBaseName - Optional String to pass in, so that if a
new library needs to be constructed for non-primitive cells
then the name of the library will default to this valuenewLibs - The collection of newLibs created during the
merge.addPrimitivesToPrimitiveLibraries - Specifies that a
primitive will be added to a primitive library in this manager,
if one exists
merge(byucc.edif.EdifLibraryManager, boolean, boolean)public boolean addLibrary(EdifLibrary library)
library - The library to add into this manager, defaulted
to add at the earliest position
findPositionToAdd(byucc.edif.EdifLibrary, boolean)
public java.util.Map createCellMap(EdifLibrary lib,
boolean checkStructure)
lib - The library to find a map for cells with in respect
to this managercheckStructure - Specifies whether to include structure
when checking cell equality
createCellMap(EdifLibraryManager,boolean)
public java.util.Map createCellMap(EdifLibraryManager libm,
boolean checkStructure)
libm - The manager to find a map for cells with in respect
to this managercheckStructure - Specifies whether to include structure
when checking cell equality
createCellMap(EdifLibrary,boolean)public boolean deleteCell(EdifCell cell)
cell - The cell to be deleted.
deleteCell(EdifCell,boolean)
public boolean deleteCell(EdifCell cell,
boolean force)
cell - The cell to be deleted.force - Forces the cell to be deleted even if it's still
referenced within the library manager.
EdifLibrary.deleteCell(EdifCell,boolean)
public EdifCell findMatchingEdifCell(EdifCell cell,
boolean equalsNameOnly,
boolean equalsStructure,
boolean equalsInterfaceOnly,
boolean comparePossibleBus)
It is possible that there are more than one cells that match the given input cell (i.e. same cell duplicated in different libraries). This method will only return the first one found.
cell - The cell to check for same name, and, if
equalsInterface is true, to check if the two cell's interfaces
are equal.equalsNameOnly - Will check matching cells for name onlyequalsStructure - Will check matching cells for structureequalsInterfaceOnly - If true then the returned EdifCell will
match the interface of the given EdifCell, otherwise,
interfaces are ignored.
EdifLibrary.findMatchingEdifCell(EdifCell),
findMatchingEdifCell(EdifCell),
findMatchingEdifCell(EdifCell,boolean,boolean,
boolean)
public EdifCell findMatchingEdifCell(EdifCell cell,
boolean equalsNameOnly,
boolean equalsStructure,
boolean equalsInterfaceOnly)
cell - The cell to check for same name, and, if
equalsInterface is true, to check if the two cell's interfaces
are equal.equalsNameOnly - Will check matching cells for name onlyequalsStructure - Will check matching cells for structureequalsInterfaceOnly - If true then the returned EdifCell will
match the interface of the given EdifCell, otherwise,
interfaces are ignored.
findMatchingEdifCell(EdifCell,boolean,
boolean,boolean,boolean)public EdifCell findMatchingEdifCell(EdifCell cell)
cell - The cell to be matched with a cell in this manager
findMatchingEdifCell(EdifCell,boolean,
boolean,boolean)
public java.util.Map findMatchingEdifCells(EdifLibraryManager elm,
boolean equalsStructure,
boolean comparePossibleBus)
elm - The manager to find a map with in respect to this
manager.equalsStructure - Specifies whether cell comparisons
should be made based on structure
EdifLibrary.findMatchingEdifCells(byucc.edif.EdifLibrary, boolean, boolean),
findMatchingEdifCells(EdifLibraryManager)
public java.util.Map findMatchingEdifCells(EdifLibraryManager elm,
boolean equalsStructure)
elm - The manager to find a map with in respect to this
manager.equalsStructure - Specifies whether cell comparisons
should be made based on structure
findMatchingEdifCells(EdifLibraryManager,
boolean,boolean)public java.util.Map findMatchingEdifCells(EdifLibraryManager elm)
elm - The library manager to find a mapping with to
the cells in this manager
findMatchingEdifCells(EdifLibraryManager,
boolean)
public java.util.Map findMatchingLibraries(EdifLibraryManager elm,
java.util.Map cellMap)
findMatchingEdifCells(byucc.edif.EdifLibraryManager, boolean, boolean) call.
The key of this Map is a library from the passed in library
manager and the value is a library from this library manager.
elm - The manager to find a mapping between libraries in
this manager that matchcellMap - Mapping between cells that map to one another.
findMatchingLibrary(EdifLibrary,Map)
public EdifLibrary findMatchingLibrary(EdifLibrary inputLibrary,
java.util.Map cellMap)
inputLibrary - Library to find a match forcellMap - Mapping between cells that match to one another.
findMatchingLibraries(EdifLibraryManager,Map)public java.util.Collection findCellInstancesOf(EdifCell cell)
cell - The cell to check references for
EdifLibrary.findCellInstancesOf(byucc.edif.EdifCell)public java.util.Collection findNonReferencedCells()
pruneNonReferencedCells()
public int findPositionToAdd(EdifLibrary add,
boolean earliest)
add - The library to be insertedearliest - Whether to insert the library into the earliest
possible position, or the latest
findEarliestPositionToAdd(byucc.edif.EdifLibrary),
findLatestPositionToAdd(byucc.edif.EdifLibrary)public int findEarliestPositionToAdd(EdifLibrary add)
add - The library to add to the earliest position
findPositionToAdd(byucc.edif.EdifLibrary, boolean)public int findLatestPositionToAdd(EdifLibrary add)
add - The library to add to the latest position
findPositionToAdd(byucc.edif.EdifLibrary, boolean)
public EdifLibrary findEarliestLibraryToAdd(EdifCell cell,
boolean addToPrimitiveLibraryOK)
cell - The cell to be added into which library.addToPrimitiveLibraryOK - Specifies whether or not it is
ok to add the cell to a primitive library.
EdifLibrary.findEarliestPositionToAdd(byucc.edif.EdifCell)public EdifLibrary findEarliestLibraryToAdd(EdifCell cell)
cell - The cell to be added into which library.
findEarliestLibraryToAdd(byucc.edif.EdifCell, boolean)
public EdifLibrary findLatestLibraryToAdd(EdifCell cell,
boolean addToPrimitiveLibraryOK)
cell - The cell to be added into which library.addToPrimitiveLibraryOK - Specifies whether or not it is
ok to add the cell to a primitive library.
EdifLibrary.findLatestPositionToAdd(byucc.edif.EdifCell)public EdifLibrary findLatestLibraryToAdd(EdifCell cell)
cell - The cell to be added into which library.
findLatestLibraryToAdd(byucc.edif.EdifCell, boolean)public java.util.Collection findBlackBoxes()
EdifLibrary.findBlackBoxes()public java.util.Collection findPortRefsOf(EdifCell cell)
cell - The cell who has the ports to check the port
references for
EdifLibrary.findPortRefsOf(byucc.edif.EdifCell)public EdifLibrary getFirstPrimitiveLibrary()
public EdifLibrary getLibrary(java.lang.String lib)
lib - The String that will be used to find the library
public EdifEnvironment getFile()
public java.util.List getLibraries()
public EdifCell getTopCell()
public EdifCellInstance getTopCellInstance()
public java.util.List getCells()
public EdifCell getCell(java.lang.String name)
name - The name of the cell to return
EdifLibrary.getCell(String)public java.util.Collection getContainingLibraries(java.lang.String name)
name - String name of cell to search for.
public java.util.Collection getNextLibraries(EdifLibrary lib)
lib - The library that designates the point after which
libraries will begin to be returned
public java.util.Collection getPreviousLibraries(EdifLibrary lib)
lib - The library that designates the point where the list
of libraries stops
public boolean isValid()
public java.util.Iterator iterator()
public boolean merge(EdifLibraryManager elm,
boolean mergeIfTopCellNotMatched,
boolean addPrimitivesToPrimitiveLibraries)
elm - The manager to merge into this managermergeIfTopCellNotMatched - If the top cell in elm is not
found in this manager, then no merging will occuraddPrimitivesToPrimitiveLibraries - This flag specifies to
place primitive cells into primitive libraries
merge(EdifLibraryManager),
addCellToTargetMergeLibrary(byucc.edif.EdifCell, java.util.Map, java.lang.String, java.util.ArrayList, boolean)public boolean merge(EdifLibraryManager elm)
elm - The manager to merge into this manager
merge(EdifLibraryManager,boolean,boolean)
void modifySinglePortsToBus(java.util.Collection oldPorts,
EdifPort newPort)
oldPorts - A Collection of EdifPort Objects to updatenewPort - The EdifPort Object to have the old ones point toEdifCell.modifySinglePortsToBus(java.util.Collection, byucc.edif.EdifPort)
void modifyBusToSinglePorts(EdifPort oldPort,
java.util.Collection newPorts)
oldPort - The old EdifPort to updatenewPorts - The Collection of EdifPort Objects to have the
old ones point toEdifCell.modifyBusToSinglePorts(byucc.edif.EdifPort, java.util.Collection)public boolean nameClash(EdifLibrary lib)
lib - The library to chech to see if there is a name clash
with this libraries of this library manager
public void pruneNonReferencedCells()
public void renameTopCellToMatchName(java.lang.String filename)
filename - The name of the file the top edif design was
translated from, and the new name of the top cell of this file.public void tagLeafCellsAsPrimitives()
public void tagPrimitives(EdifLibrary primitives)
primitives - Library containing primitives to be compared
to cells.EdifCell.tagAsPrimitive(byucc.edif.EdifLibrary)public void trimToSize()
trimToSize in interface Trimablepublic void uniqueify()
private void updateCellRefs(EdifCell oldCell,
EdifCell newCell)
oldCell - Cell whose information must be replacednewCell - Cell whose information will replace the old
cell's informationpublic void validateOrder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||