edu.byu.ece.edif.core
Class EdifCell

java.lang.Object
  extended by edu.byu.ece.edif.core.NamedPropertyObject
      extended by edu.byu.ece.edif.core.EdifCell
All Implemented Interfaces:
EdifOut, Properties, Trimable, java.io.Serializable
Direct Known Subclasses:
FlattenedEdifCell, FlattenedEdifCellLite, HalfLatchEdifCell

public class EdifCell
extends NamedPropertyObject
implements EdifOut, Trimable

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:

Name Space:

Version:
$Id:EdifCell.java 198 2008-04-16 21:14:21Z jamesfcarroll $
See Also:
EdifPort, EdifCellInstance, EdifNet, EdifLibrary, Serialized Form

Field Summary
private  java.util.Collection<java.lang.String> _bbInstanceList
           
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).
static long serialVersionUID
           
 
Constructor Summary
EdifCell(EdifLibrary lib, EdifCell cell, EdifNameable name)
          Deprecated. This method is only used by the old HalfLatchEdifCell constructor and the old lut replacement. This method should be removed once these old methods and classes are removed.
EdifCell(EdifLibrary lib, EdifCell cell, java.lang.String name)
          Deprecated. Only called by the constructor below.
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
 void addBlackBoxResource(java.lang.String type)
           
 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<EdifCellInstance> 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)
          Deprecated. Only used by deprecated methods. Do not use in new methods.
 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<EdifCellInstance> findCellInstancesOf(EdifCell type)
          This function returns all EdifCellInstances within this EdifCell object that reference a given cell in this library (i.e.
 java.util.Collection<java.lang.String> getBlackBoxResources()
           
 EdifCellInstance getCellInstance(java.lang.String name)
          Return the EdifCellInstance contained within this EdifCell Object that matches the passed-in name.
 java.util.Collection<EdifCellInstance> getCellInstanceList()
          Return a Collection of the EdifCellInstance objects in this EdifCell
 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<EdifCell> 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<EdifCellInstance> getSafeCellInstanceList()
           
 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 isFlat()
           
 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 edu.byu.ece.edif.core.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

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

_cellInstanceList

private EdifNameSpaceMap<EdifCellInstance> _cellInstanceList
This List is used to hold all of the instanced children within the cell (EdifCellInstance). No space is initially allocated for this list since primitive cells will not contain cell instances.


_bbInstanceList

private java.util.Collection<java.lang.String> _bbInstanceList

_interface

private EdifCellInterface _interface
The port interface of this EdifCell.


_isPrimitive

private boolean _isPrimitive
This flag indicates that the given EdifCell is a library "primitive" and does not contain any internal hierarchy (i.e. cell instances or nets). Note that a "primitive" EdifCell is different than an EdifCell that has no internal cell instances or nets. An "empty" EdifCell that is not a primitive corresponds to a "black box" or an EdifCell object whose contents have not been defined. It is called a "black box" because we do not know what is inside of it. A primitive, however, is known to be a leaf-cell.

This field is atomic, meaning that it can only be set in the constructor.

See Also:
isLeafCell(), isPrimitive()

_library

private EdifLibrary _library
The EdifCell is defined within an Edif_Library. This field member defines the Edif_Library that owns this cell.


_netList

private EdifNameSpaceMap<EdifNet> _netList
This List is used to hold all the internal nets in this cell (EdifNet).

Constructor Detail

EdifCell

public EdifCell(EdifLibrary lib,
                java.lang.String name)
         throws EdifNameConflictException,
                InvalidEdifNameException
Throws:
EdifNameConflictException
InvalidEdifNameException

EdifCell

public EdifCell(EdifLibrary lib,
                EdifNameable name)
         throws EdifNameConflictException
Throws:
EdifNameConflictException

EdifCell

public EdifCell(EdifLibrary lib,
                java.lang.String name,
                EdifCellInterface iface)
         throws EdifNameConflictException,
                InvalidEdifNameException
Throws:
EdifNameConflictException
InvalidEdifNameException

EdifCell

public EdifCell(EdifLibrary lib,
                java.lang.String name,
                boolean isPrimitive)
         throws EdifNameConflictException,
                InvalidEdifNameException
Throws:
EdifNameConflictException
InvalidEdifNameException

EdifCell

public EdifCell(EdifLibrary lib,
                EdifNameable name,
                boolean isPrimitive)
         throws EdifNameConflictException
Throws:
EdifNameConflictException

EdifCell

public EdifCell(EdifLibrary lib,
                EdifCell cell,
                java.lang.String name)
         throws EdifNameConflictException,
                InvalidEdifNameException
Deprecated. Only called by the constructor below.

Throws:
EdifNameConflictException
InvalidEdifNameException

EdifCell

public EdifCell(EdifLibrary lib,
                EdifCell cell,
                EdifNameable name)
         throws EdifNameConflictException,
                InvalidEdifNameException
Deprecated. This method is only used by the old HalfLatchEdifCell constructor and the old lut replacement. This method should be removed once these old methods and classes are removed.

Throws:
EdifNameConflictException
InvalidEdifNameException
Method Detail

addNet

public boolean addNet(EdifNet net)
               throws EdifNameConflictException
Add an EdifNet object to the EdifCell. This sets the parent of the EdifNet object to the current EdifCell object.

Parameters:
net - EdifNet object to add to the EdifCell
Throws:
EdifNameConflictException

addPort

public EdifPort addPort(EdifNameable name,
                        int width,
                        int direction)
                 throws EdifNameConflictException
Adds a new port to the EdifCellInterface.

Parameters:
name - The name of the new port to add
width - The width of the new port to add
direction - The direction of the new port to add
Throws:
EdifNameConflictException

addPort

public EdifPort addPort(java.lang.String name,
                        int width,
                        int direction)
                 throws InvalidEdifNameException,
                        EdifNameConflictException
Adds a new port to the EdifCellInterface.

Parameters:
name - The name of the new port to add
width - The width of the new port to add
direction - The direction of the new port to add
Throws:
InvalidEdifNameException
EdifNameConflictException

addPortUniqueName

public EdifPort addPortUniqueName(EdifNameable name,
                                  int width,
                                  int direction)

addPortUniqueName

public EdifPort addPortUniqueName(java.lang.String name,
                                  int width,
                                  int direction)
                           throws InvalidEdifNameException
Throws:
InvalidEdifNameException

addSubCell

public boolean addSubCell(EdifCellInstance cellInstance)
                   throws EdifNameConflictException
Add an 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.

Parameters:
cellInstance - EdifCellInstance object to add to the EdifCell
Throws:
EdifNameConflictException

addSubCellUniqueName

public EdifNameable addSubCellUniqueName(EdifCellInstance cellInstance)

cellInstanceIterator

public java.util.Iterator<EdifCellInstance> cellInstanceIterator()
Returns an Iterator of this cell's cellInstances.

Returns:
An Iterator Object of all the EdifCellInstances contained within this EdifCell Object

contains

public boolean contains(EdifCellInstance contain)
Checks to see if the passed-in EdifCellInstance is already contained within this EdifCell. Equality is done using ==.

Parameters:
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
Returns:
True if the passed-in EdifCellInstance is already contained within this EdifCell Object

contains

public boolean contains(EdifPort contain)
Checks to see if the passed-in EdifPort is already contained within this EdifCell. Equality is done using ==.

Parameters:
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
Returns:
True if the passed-in EdifPort is already contained within this EdifCell Object

contains

public boolean contains(EdifNet contain)
Checks to see if the passed-in EdifNet is already contained within this EdifCell. Equality is done using ==.

Parameters:
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
Returns:
True if the passed-in EdifNet is already contained within this EdifCell Object

deleteNet

public boolean deleteNet(EdifNet delete)
Delete the given net from this EdifCell.

Parameters:
delete - The EdifNet to delete
Returns:
True if it was deleted, false otherwise

deletePort

public void deletePort(EdifPort delete)
Delete the given port from this EdifCell.

Parameters:
delete - The EdifPort to delete

deleteSubCell

public boolean deleteSubCell(EdifCellInstance cellInstance,
                             boolean removeRefsInNets)
Remove an EdifCellInstance object from the current EdifCell object. Return true if the instance was found and successfully removed, otherwise false.

Parameters:
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
Returns:
boolean indicating whether the EdifCellInstance object was successfully found and removed

deleteSubCell

public boolean deleteSubCell(EdifCellInstance cellInstance)

equalsInterface

public boolean equalsInterface(EdifCell cell)
Determine if the given EdifCell has the same interface as the current EdifCell. This is an overloaded method that defaults to not comparing by possible bus.

Parameters:
cell - The cell used for the interface comparison
Returns:
True if the interfaces are equal
See Also:
EdifCellInterface.equals(EdifCellInterface)

equalsName

public 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.

Parameters:
cell - Cell to compare
Returns:
Returns true if the names are the same.

getCellInstanceList

public java.util.Collection<EdifCellInstance> getCellInstanceList()
Return a Collection of the EdifCellInstance objects in this EdifCell

TODO: Return a new object rather than the actual _cellInstanceList

Returns:

getSafeCellInstanceList

public java.util.Collection<EdifCellInstance> getSafeCellInstanceList()

findCellInstancesOf

public java.util.Collection<EdifCellInstance> findCellInstancesOf(EdifCell type)
This function returns all EdifCellInstances within this EdifCell object that reference a given cell in this library (i.e. the same type as the given cell). If no EdifCellInstances of this type are found, this method will return null.

Parameters:
type - The EdifCell Object to find references to within this EdifCell
Returns:
A Collection of EdifCellInstances contained within this EdifCell that reference the passed-in EdifCell

getCellInstance

public EdifCellInstance getCellInstance(java.lang.String name)
Return the EdifCellInstance contained within this EdifCell Object that matches the passed-in name.

Parameters:
name - The String used to match the returned EdifCellInstance
Returns:
The EdifCellInstance Object whose name matches the passed-in name

getDanglingNets

public java.util.Collection getDanglingNets(boolean inputNoOutput,
                                            boolean outputsOnly)
Dangling net is not connected to any outputs. Outer ports labeled IN and inner ports labeled OUT are inputs. Outer ports labeled OUT and inner ports labeled IN are outputs. Each net must have at least one output and one input.

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.

Parameters:
inputNoOutput - Only returns nets with input(s) and no outputs, if true
outputsOnly - If true, this method will only return nets with outputs and no inputs
Returns:
A Collection of EdifNet Objects that have no outputs (they are dangling)

getDanglingNets

public java.util.Collection getDanglingNets()
Dangling net is not connected to any outputs. Outer ports labeled IN and inner ports labeled OUT are inputs. Outer ports labeled OUT and inner ports labeled IN are outputs. Each net must have at least one output and one input.

Note: By default this method will only return nets with only inputs or nets with only outputs.

Returns:
A Collection of EdifNet Objects that have no outputs (they are dangling)
See Also:
getDanglingNets(boolean,boolean)

getHierarchicalPrimitiveList

public java.util.Collection getHierarchicalPrimitiveList()
Return a Collection with a List object for each primitive instance within the hierarchy of this cell. Leaf cells will return a null Collection.

Returns:
A Collection of List Objects of EdifCellInstance Objects that are in order of hierarchy down to primitives

getInnerCells

public java.util.Collection getInnerCells()
Return a Collection of all EdifCells instanced by the EdifCellInstances contained within this EdifCell Object.

Returns:
A Collection of all the different EdifCell "types" instanced as sub-cells within the current EdifCell

getInputPorts

public java.util.Collection getInputPorts()
Returns:
A Collection object containing all input ports

getInstance

public EdifCellInstance getInstance(java.lang.String name)
Return the EdifCellInstance Object that matches the passed-in name, or null if not found.

Parameters:
name - The name of the EdifCellInstance to return
Returns:
The EdifCellInstance Object that matches the passed-in name or null

getInstancedCellTypes

public java.util.Collection<EdifCell> getInstancedCellTypes()
Return all unique EdifCell objects that are instanced within this EdifCell object. This method will iterate through all of the EdifCellInstances and collect each unique EdifCell object that is instanced.

Returns:
A Collection of EdifCell Objects

getInstancePortNet

public EdifNet getInstancePortNet(EdifCellInstance instance,
                                  EdifPort port)
This method will return the EdifNet that is connected to the given port on the given instance.

Parameters:
instance - The EdifCellInstance Object that one of the returned EdifNet Object's EdifPortRef Objects connects to
port - The EdifPort Object that one of the returned EdifNet Object's EdifPortRef Objects refers to
Returns:
An EdifNet Object that has an EdifPortRef Object that refers to the passed-in EdifPort Object, and connects to the passed-in EdifCellInstance Object

getInterface

public EdifCellInterface getInterface()
Return the EdifCellInterface of this EdifCell.

Returns:
An EdifCellInterface Object that defines the port interface of this EdifCell

getLibrary

public EdifLibrary getLibrary()
Return the EdifLibrary object to which the current EdifCell object belongs.

Returns:
EdifLibrary object to which the current EdifCell object belongs

getMatchingPort

public EdifPort getMatchingPort(EdifPort port)
Return the EdifPort object which defines a port on the current EdifCell object and corresponds to the given name. If no such EdifPort is found, a null object is returned.

Parameters:
port - The EdifPort to find a match for within this EdifCellInterface
Returns:
The EdifPort corresponding to the passed-in port

getNet

public EdifNet getNet(java.lang.String name)
Return the net that maps to the given name.

Parameters:
name - The key name of the EdifNet to retrieve
Returns:
An EdifNet Object mapped to the given name

getNetList

public java.util.Collection<EdifNet> getNetList()
Return a List containing all of the EdifNet objects which this EdifCell object currently owns.

Returns:
A Collection containing the EdifNet objects owned by the current EdifCell object

getOutputPorts

public java.util.Collection<EdifPort> getOutputPorts()
Returns:
a Collection Object of the output ports

getPort

public 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. If no such EdifPort is found, a null object is returned.

Parameters:
name - A string indicating the name of the EdifPort object desired to be found
Returns:
The EdifPort corresponding to the given name

getPortList

public java.util.Collection<EdifPort> getPortList()
Return a Collection containing all of the EdifPort objects currently associated with this EdifCell object.

Returns:
Collection containing the EdifPort objects associated with the current EdifCell object

getPortRefs

public java.util.Collection getPortRefs()
Returns:
a collection of all EdifPortRef objects owned by this cell. This method will iterate over each Net in the Cell and include all EdifPortRef objects owned by each Net.
See Also:
EdifNet.getPortRefIterator()

getSortedNetList

public java.util.Collection getSortedNetList()
Return a sorted Collection containing all of the EdifNet objects currently by this EdifCell object. The objects in the Collection are sorted by their names.

Returns:
Sorted Collection containing the EdifNet objects owned by the current EdifCell object

getSortedPortList

public java.util.Collection getSortedPortList()
Return a sorted Collection containing all of the EdifPort objects currently associated with this EdifCell object. The objects in the Collection are sorted by their names.

Returns:
Sorted Collection containing the EdifPort objects associated with the current EdifCell object

getSortedPropertyList

public java.util.TreeMap getSortedPropertyList()
Return a TreeMap of all Property objects corresponding to properties of the current EdifCell object.

Returns:
TreeMap containing all properties of the EdifCell object in the form of Property objects

getSortedSubCellList

public java.util.Collection getSortedSubCellList()
Return a Collection of EdifCellInstance objects owned and instantiated by the current EdifCell object. The EdifCellInstance objects are sorted based on their names.

Returns:
sorted Collection containing all EdifCellInstance objects owned by this EdifCell
See Also:
getSubCellList()

getSubCellList

public java.util.Collection<EdifCellInstance> getSubCellList()
Return a Collection of EdifCellInstance objects owned and instantiated by the current EdifCell object.

Returns:
A Collection containing all EdifCellInstance objects owned by this EdifCell. If this EdifCell contains no EdifCellInstances, returns an empty (non-null) Collection.
See Also:
getSortedSubCellList()

getUnconnectedInstances

public java.util.Collection getUnconnectedInstances()
Return a Collection of EdifCellInstance objects that are not connected to any EdifNet in the Cell.


getUnconnectedInnerPorts

public java.util.Map<EdifCellInstance,java.util.Collection<EdifPort>> getUnconnectedInnerPorts()

getUnconnectedOuterPorts

public java.util.Collection<EdifPort> getUnconnectedOuterPorts()

getUniqueInstanceNameable

public EdifNameable getUniqueInstanceNameable(EdifNameable en)

getUniqueInstanceNameable

public EdifNameable getUniqueInstanceNameable(EdifCellInstance instance)

getUniqueNetNameable

public EdifNameable getUniqueNetNameable(EdifNameable en)

getUniqueNetNameable

public EdifNameable getUniqueNetNameable(EdifNet net)

isBlackBox

public 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.

Returns:
boolean indicating if this EdifCell is a black box

isFlat

public boolean isFlat()
Returns:
true if this EdifCell is flat; that is, if all the cells within this cell are leaf cells.

isLeafCell

public boolean isLeafCell()
Return true if the current EdifCell object has no children in its EdifCellInstance list; otherwise, returns false.

Returns:
boolean indicating if this EdifCell is a leaf cell

isPrimitive

public boolean isPrimitive()
Return whether or not this is a known primitive cell. Note that this is different than a "black box". A black box is a an empty EdifCell whose contents have not been defined.

Returns:
True if this cell is a primitive

modifyCellType

public 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.

Parameters:
oldType - EdifCell type to change from
newType - EdifCell type to change to

netListIterator

public java.util.Iterator netListIterator()
Return an iterator of this cell's nets.

Returns:
An Iterator Object of all the EdifNets contained in this EdifCell

setInterface

public void setInterface(EdifCellInterface iface)
This method sets the interface of the cell. While this may be dangerous to allow changes to the interface, it allows the parser to set the interface after the object has been created.

Parameters:
iface -

setPrimitive

public void setPrimitive()
Sets this cell to primitive.


tagAsPrimitive

public void tagAsPrimitive(EdifLibrary primitives)
Tag this cell as primitive if it matches a cell in the passed-in library.

Parameters:
primitives - library of primitives that will be compared to this cell.

toEdif

public void toEdif(EdifPrintWriter epw)
Write the EDIF representation of this EdifCell object to the EdifPrintWriter passed as a parameter.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - EdifPrintWriter to which EDIF will be written

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
A String representing this Object's name and port interface

trimToSize

public void trimToSize()
This method will trim the size of all collections contained by this class. Trimming each collection will reduce the memory consumed by this object by getting rid of all unused collection references. This method will also call trimToSize on each of the EdifNet objects in the _netList collection.

Specified by:
trimToSize in interface Trimable

copyCellInternals

protected void copyCellInternals(EdifCell cell)
                          throws EdifNameConflictException
Deprecated. Only used by deprecated methods. Do not use in new methods.

Parameters:
cell -
Throws:
EdifNameConflictException

setLibrary

void setLibrary(EdifLibrary library)
Set the library for this EdifCell object. This method should only be called by EdifLibrary.addCell(EdifCell) after adding the cell to the library.

Parameters:
library - EdifLibrary object to set as the library of the current EdifCell

addBlackBoxResource

public void addBlackBoxResource(java.lang.String type)

getBlackBoxResources

public java.util.Collection<java.lang.String> getBlackBoxResources()