|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbyucc.edif.NamedPropertyObject
byucc.edif.EdifCell
public class EdifCell
Represents an EDIF cell definition. This class is not tied to any target language or implementation (i.e. VHDL, JHDL, etc).
This implementation of EdifCell contains Lists of all EdifCellInstance, EdifNet, and EdifPort objects associated
with this EdifCell object. Additionally, this class contains a reference to
the EdifLibrary object which owns the EdifCell object.
This class may allocate a large amount of memory to represent a given cell.
To help control the memory allocation, this class implements the
Trimable interface for trimming unneeded memory.
Sample EDIF code for an EdifCell:
(cell graycount (cellType GENERIC)
(view netlist (viewType NETLIST)
(interface
(port G_5322 (direction INPUT))
...
)
(contents
(instance (rename count_0 "count[0]") (viewRef PRIM (cellRef FDCE (libraryRef UNILIB)))
...
(net (rename write_addrgray_pre_0 "WRITE_ADDRGRAY_PRE(0)") (joined
(portRef (member write_addrgray_pre 3))
(portRef Q (instanceRef count_gray_0))
)
)
...
)
)
)
)
Definitions
There are a number of terms that are used to describe the various components of an EdifCell. This list serves as the definition of these terms to insure consistent and understandable usage.
To Do:
removeEdifCellInstance? - added a flag
to remove references in EdifNets to the deleted EdifCellInstance
EdifPort,
EdifCellInstance,
EdifNet,
EdifLibrary| Field Summary | |
|---|---|
private EdifNameSpaceMap<EdifCellInstance> |
_cellInstanceList
This List is used to hold all of the instanced children within the cell (EdifCellInstance). |
private EdifCellInterface |
_interface
The port interface of this EdifCell. |
private boolean |
_isPrimitive
This flag indicates that the given EdifCell is a library "primitive" and does not contain any internal hierarchy (i.e. |
private EdifLibrary |
_library
The EdifCell is defined within an Edif_Library. |
private EdifNameSpaceMap<EdifNet> |
_netList
This List is used to hold all the internal nets in this cell (EdifNet). |
| Constructor Summary | |
|---|---|
EdifCell(EdifLibrary lib,
EdifCell cell)
|
|
EdifCell(EdifLibrary lib,
EdifCell cell,
EdifNameable name)
|
|
EdifCell(EdifLibrary lib,
EdifCell cell,
java.lang.String name)
|
|
EdifCell(EdifLibrary lib,
EdifNameable name)
|
|
EdifCell(EdifLibrary lib,
EdifNameable name,
boolean isPrimitive)
|
|
EdifCell(EdifLibrary lib,
java.lang.String name)
|
|
EdifCell(EdifLibrary lib,
java.lang.String name,
boolean isPrimitive)
|
|
EdifCell(EdifLibrary lib,
java.lang.String name,
EdifCellInterface iface)
|
|
| Method Summary | |
|---|---|
boolean |
addNet(EdifNet net)
Add an EdifNet object to the EdifCell. |
EdifPort |
addPort(EdifNameable name,
int width,
int direction)
Adds a new port to the EdifCellInterface. |
EdifPort |
addPort(java.lang.String name,
int width,
int direction)
Adds a new port to the EdifCellInterface. |
EdifPort |
addPortUniqueName(EdifNameable name,
int width,
int direction)
|
EdifPort |
addPortUniqueName(java.lang.String name,
int width,
int direction)
|
boolean |
addSubCell(EdifCellInstance cellInstance)
Add an EdifCellInstance object to the EdifCell. |
EdifNameable |
addSubCellUniqueName(EdifCellInstance cellInstance)
|
java.util.Iterator |
cellInstanceIterator()
Returns an Iterator of this cell's cellInstances. |
boolean |
contains(EdifCellInstance contain)
Checks to see if the passed-in EdifCellInstance is already contained within this EdifCell. |
boolean |
contains(EdifNet contain)
Checks to see if the passed-in EdifNet is already contained within this EdifCell. |
boolean |
contains(EdifPort contain)
Checks to see if the passed-in EdifPort is already contained within this EdifCell. |
protected void |
copyCellInternals(EdifCell cell)
|
boolean |
deleteNet(EdifNet delete)
Delete the given net from this EdifCell. |
void |
deletePort(EdifPort delete)
Delete the given port from this EdifCell. |
boolean |
deleteSubCell(EdifCellInstance cellInstance)
|
boolean |
deleteSubCell(EdifCellInstance cellInstance,
boolean removeRefsInNets)
Remove an EdifCellInstance object from the current EdifCell object. |
boolean |
equalsInterface(EdifCell cell)
Determine if the given EdifCell has the same interface as the current EdifCell. |
boolean |
equalsName(EdifCell cell)
This method will determine if the name of this EdifCell is the same as the name of the passed in EdifCell. |
java.util.Collection |
findCellInstancesOf(EdifCell type)
This function returns all EdifCellInstances within this EdifCell object that reference a given cell in this library (i.e. |
EdifCellInstance |
getCellInstance(java.lang.String name)
Return the EdifCellInstance contained within this EdifCell Object that matches the passed-in name. |
java.util.Collection |
getDanglingNets()
Dangling net is not connected to any outputs. |
java.util.Collection |
getDanglingNets(boolean inputNoOutput,
boolean outputsOnly)
Dangling net is not connected to any outputs. |
java.util.Collection |
getHierarchicalPrimitiveList()
Return a Collection with a List object for each primitive instance within the hierarchy of this cell. |
java.util.Collection |
getInnerCells()
Return a Collection of all EdifCells instanced by the EdifCellInstances contained within this EdifCell Object. |
java.util.Collection |
getInputPorts()
|
EdifCellInstance |
getInstance(java.lang.String name)
Return the EdifCellInstance Object that matches the passed-in name, or null if not found. |
java.util.Collection |
getInstancedCellTypes()
Return all unique EdifCell objects that are instanced within this EdifCell object. |
EdifNet |
getInstancePortNet(EdifCellInstance instance,
EdifPort port)
This method will return the EdifNet that is connected to the given port on the given instance. |
EdifCellInterface |
getInterface()
Return the EdifCellInterface of this EdifCell. |
EdifLibrary |
getLibrary()
Return the EdifLibrary object to which the current EdifCell
object belongs. |
EdifPort |
getMatchingPort(EdifPort port)
Return the EdifPort object which defines a port on the current EdifCell object and corresponds to the given name. |
EdifNet |
getNet(java.lang.String name)
Return the net that maps to the given name. |
java.util.Collection<EdifNet> |
getNetList()
Return a List containing all of the EdifNet objects which this EdifCell object currently owns. |
java.util.Collection<EdifPort> |
getOutputPorts()
|
EdifPort |
getPort(java.lang.String name)
Return the EdifPort object which defines a port on the current EdifCell object and corresponds to the given name. |
java.util.Collection<EdifPort> |
getPortList()
Return a Collection containing all of the EdifPort objects currently associated with this EdifCell object. |
java.util.Collection |
getPortRefs()
|
java.util.Collection |
getSortedNetList()
Return a sorted Collection containing all of the EdifNet objects currently by this EdifCell object. |
java.util.Collection |
getSortedPortList()
Return a sorted Collection containing all of the EdifPort objects currently associated with this EdifCell object. |
java.util.TreeMap |
getSortedPropertyList()
Return a TreeMap of all Property objects corresponding to
properties of the current EdifCell object. |
java.util.Collection |
getSortedSubCellList()
Return a Collection of EdifCellInstance objects owned and instantiated by the current EdifCell object. |
java.util.Collection<EdifCellInstance> |
getSubCellList()
Return a Collection of EdifCellInstance objects owned and instantiated by the current EdifCell object. |
java.util.Map<EdifCellInstance,java.util.Collection<EdifPort>> |
getUnconnectedInnerPorts()
|
java.util.Collection |
getUnconnectedInstances()
Return a Collection of EdifCellInstance objects that are not connected to any EdifNet in the Cell. |
java.util.Collection<EdifPort> |
getUnconnectedOuterPorts()
|
EdifNameable |
getUniqueInstanceNameable(EdifCellInstance instance)
|
EdifNameable |
getUniqueInstanceNameable(EdifNameable en)
|
EdifNameable |
getUniqueNetNameable(EdifNameable en)
|
EdifNameable |
getUniqueNetNameable(EdifNet net)
|
boolean |
isBlackBox()
Return true if the current EdifCell object is not a
primitive, has no children in its EdifCellInstance list and no EdifNet
objects in its EdifNet list; otherwise, returns false. |
boolean |
isLeafCell()
Return true if the current EdifCell object has no children
in its EdifCellInstance list; otherwise, returns false. |
boolean |
isPrimitive()
Return whether or not this is a known primitive cell. |
void |
modifyCellType(EdifCell oldType,
EdifCell newType)
Find all instances within the EdifCell of type oldType and change them to type newType if their interfaces match. |
java.util.Iterator |
netListIterator()
Return an iterator of this cell's nets. |
void |
setInterface(EdifCellInterface iface)
This method sets the interface of the cell. |
(package private) void |
setLibrary(EdifLibrary library)
Set the library for this EdifCell object. |
void |
setPrimitive()
Sets this cell to primitive. |
void |
tagAsPrimitive(EdifLibrary primitives)
Tag this cell as primitive if it matches a cell in the passed-in library. |
void |
toEdif(EdifPrintWriter epw)
Write the EDIF representation of this EdifCell object to the EdifPrintWriter passed as a parameter. |
java.lang.String |
toString()
|
void |
trimToSize()
This method will trim the size of all collections contained by this class. |
| Methods inherited from class byucc.edif.NamedPropertyObject |
|---|
addProperty, addProperty, addPropertyList, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, rename, rename |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private EdifNameSpaceMap<EdifCellInstance> _cellInstanceList
private EdifCellInterface _interface
private boolean _isPrimitive
This field is atomic, meaning that it can only be set in the constructor.
isLeafCell(),
isPrimitive()private EdifLibrary _library
private EdifNameSpaceMap<EdifNet> _netList
| Constructor Detail |
|---|
public EdifCell(EdifLibrary lib,
java.lang.String name)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException
public EdifCell(EdifLibrary lib,
EdifNameable name)
throws EdifNameConflictException
EdifNameConflictException
public EdifCell(EdifLibrary lib,
java.lang.String name,
EdifCellInterface iface)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException
public EdifCell(EdifLibrary lib,
java.lang.String name,
boolean isPrimitive)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException
public EdifCell(EdifLibrary lib,
EdifNameable name,
boolean isPrimitive)
throws EdifNameConflictException
EdifNameConflictException
public EdifCell(EdifLibrary lib,
EdifCell cell)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException
public EdifCell(EdifLibrary lib,
EdifCell cell,
java.lang.String name)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException
public EdifCell(EdifLibrary lib,
EdifCell cell,
EdifNameable name)
throws EdifNameConflictException,
InvalidEdifNameException
EdifNameConflictException
InvalidEdifNameException| Method Detail |
|---|
public boolean addNet(EdifNet net)
throws EdifNameConflictException
EdifNet object to the EdifCell. This sets the parent of
the EdifNet object to the current EdifCell object.
net - EdifNet object to add to the EdifCell
EdifNameConflictException
public EdifPort addPort(EdifNameable name,
int width,
int direction)
throws EdifNameConflictException
name - The name of the new port to addwidth - The width of the new port to adddirection - The direction of the new port to add
EdifNameConflictException
public EdifPort addPort(java.lang.String name,
int width,
int direction)
throws InvalidEdifNameException,
EdifNameConflictException
name - The name of the new port to addwidth - The width of the new port to adddirection - The direction of the new port to add
InvalidEdifNameException
EdifNameConflictException
public EdifPort addPortUniqueName(EdifNameable name,
int width,
int direction)
public EdifPort addPortUniqueName(java.lang.String name,
int width,
int direction)
throws InvalidEdifNameException
InvalidEdifNameException
public boolean addSubCell(EdifCellInstance cellInstance)
throws EdifNameConflictException
EdifCellInstance object to the EdifCell. The parent of the
EdifCellInstance is set to the current EdifCell object.
TODO: we need to give the user the option of not allowing renaming. TODO:
create a method addSubCell (EdifCell, name) that creates the
edifcellinstance automatically for the user.
cellInstance - EdifCellInstance object to add to the EdifCell
EdifNameConflictExceptionpublic EdifNameable addSubCellUniqueName(EdifCellInstance cellInstance)
public java.util.Iterator cellInstanceIterator()
public boolean contains(EdifCellInstance contain)
contain - The EdifCellInstance to compare against the
EdifCellInstance Objects contained within this EdifCell Object to
check to see if it already exists in this EdifCell
public boolean contains(EdifPort contain)
contain - The EdifPort to compare against the EdifPort Objects
contained within this EdifCell Object to check to see if it
already exists in this EdifCell
public boolean contains(EdifNet contain)
contain - The EdifNet to compare against the EdifNet Objects
contained within this EdifCell Object to check to see if it
already exists in this EdifCell
public boolean deleteNet(EdifNet delete)
delete - The EdifNet to delete
public void deletePort(EdifPort delete)
delete - The EdifPort to delete
public boolean deleteSubCell(EdifCellInstance cellInstance,
boolean removeRefsInNets)
true if the instance was found and successfully
removed, otherwise false.
cellInstance - EdifCellInstance object to remove from the current
EdifCell object.removeRefsInNets - Deletes all references to this instance in all
the nets within this EdifCell, if true
public boolean deleteSubCell(EdifCellInstance cellInstance)
public boolean equalsInterface(EdifCell cell)
cell - The cell used for the interface comparison
EdifCellInterface.equals(EdifCellInterface)public boolean equalsName(EdifCell cell)
cell - Cell to compare
public java.util.Collection findCellInstancesOf(EdifCell type)
type - The EdifCell Object to find references to within this
EdifCell
public EdifCellInstance getCellInstance(java.lang.String name)
name - The String used to match the returned EdifCellInstance
public java.util.Collection getDanglingNets(boolean inputNoOutput,
boolean outputsOnly)
Note: By default (false and false gets passed to this method) this method will only return nets with only inputs or nets with only outputs. Also, if inputNoOutput is true then the value of outputsOnly gets over-ridden.
inputNoOutput - Only returns nets with input(s) and no outputs, if
trueoutputsOnly - If true, this method will only return nets with
outputs and no inputs
public java.util.Collection getDanglingNets()
Note: By default this method will only return nets with only inputs or nets with only outputs.
getDanglingNets(boolean,boolean)public java.util.Collection getHierarchicalPrimitiveList()
public java.util.Collection getInnerCells()
public java.util.Collection getInputPorts()
public EdifCellInstance getInstance(java.lang.String name)
name - The name of the EdifCellInstance to return
public java.util.Collection getInstancedCellTypes()
public EdifNet getInstancePortNet(EdifCellInstance instance,
EdifPort port)
instance - The EdifCellInstance Object that one of the returned
EdifNet Object's EdifPortRef Objects connects toport - The EdifPort Object that one of the returned EdifNet Object's
EdifPortRef Objects refers to
public EdifCellInterface getInterface()
public EdifLibrary getLibrary()
EdifLibrary object to which the current EdifCell
object belongs.
public EdifPort getMatchingPort(EdifPort port)
port - The EdifPort to find a match for within this
EdifCellInterface
public EdifNet getNet(java.lang.String name)
name - The key name of the EdifNet to retrieve
public java.util.Collection<EdifNet> getNetList()
public java.util.Collection<EdifPort> getOutputPorts()
public EdifPort getPort(java.lang.String name)
name - A string indicating the name of the EdifPort object desired
to be found
public java.util.Collection<EdifPort> getPortList()
public java.util.Collection getPortRefs()
EdifNet.getPortRefIterator()public java.util.Collection getSortedNetList()
public java.util.Collection getSortedPortList()
public java.util.TreeMap getSortedPropertyList()
Property objects corresponding to
properties of the current EdifCell object.
public java.util.Collection getSortedSubCellList()
getSubCellList()public java.util.Collection<EdifCellInstance> getSubCellList()
getSortedSubCellList()public java.util.Collection getUnconnectedInstances()
public java.util.Map<EdifCellInstance,java.util.Collection<EdifPort>> getUnconnectedInnerPorts()
public java.util.Collection<EdifPort> getUnconnectedOuterPorts()
public EdifNameable getUniqueInstanceNameable(EdifNameable en)
public EdifNameable getUniqueInstanceNameable(EdifCellInstance instance)
public EdifNameable getUniqueNetNameable(EdifNameable en)
public EdifNameable getUniqueNetNameable(EdifNet net)
public boolean isBlackBox()
true if the current EdifCell object is not a
primitive, has no children in its EdifCellInstance list and no EdifNet
objects in its EdifNet list; otherwise, returns false.
public boolean isLeafCell()
true if the current EdifCell object has no children
in its EdifCellInstance list; otherwise, returns false.
public boolean isPrimitive()
public void modifyCellType(EdifCell oldType,
EdifCell newType)
oldType - EdifCell type to change fromnewType - EdifCell type to change topublic java.util.Iterator netListIterator()
public void setInterface(EdifCellInterface iface)
iface - public void setPrimitive()
public void tagAsPrimitive(EdifLibrary primitives)
primitives - library of primitives that will be compared to this
cell.public void toEdif(EdifPrintWriter epw)
EdifPrintWriter passed as a parameter.
toEdif in interface EdifOutepw - EdifPrintWriter to which EDIF will be writtenpublic java.lang.String toString()
toString in class java.lang.Objectpublic void trimToSize()
trimToSize in interface Trimable
protected void copyCellInternals(EdifCell cell)
throws EdifNameConflictException
cell -
EdifNameConflictExceptionvoid setLibrary(EdifLibrary library)
EdifLibrary.addCell(EdifCell) after adding the cell to
the library.
library - EdifLibrary object to set as the library of the current
EdifCell
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||