com.sun.electric.database.hierarchy
Class HierarchyEnumerator.CellInfo

java.lang.Object
  extended by com.sun.electric.database.hierarchy.HierarchyEnumerator.CellInfo
Direct Known Subclasses:
LENetlister.LECellInfo, ParasiticTool.ParasiticCellInfo, Topology.MyCellInfo
Enclosing class:
HierarchyEnumerator

public static class HierarchyEnumerator.CellInfo
extends java.lang.Object

The CellInfo object is used to pass information to the Visitor during the enumeration. The CellInfo object contains many methods that describe the Cell currently being enumerated and the state of the enumeration.

The HierarchyEnumerator creates a new CellInfo for a Cell instance just before it begins enumerating the contents of that Cell instance. The HierarchyEnumerator abandons the CellInfo once it is done enumerating the contents of that Cell instance. Once the CellInfo is abandoned the garbage collector may reclaim the CellInfo's storage.

Each CellInfo has a reference to the CellInfo of the parent of the current Cell instance. Thus the Visitor is able to get information about all the ancestors of the current Cell instance.

In most cases, the user will need to store additional information in the CellInfo. In those cases the user should extend the CellInfo class and override the Visitor.newCellInfo() method to return an instance of the derived class.


Constructor Summary
HierarchyEnumerator.CellInfo()
           
 
Method Summary
 Cell getCell()
          The Cell currently being visited.
 VarContext getContext()
          The VarContext to use for evaluating all variables in the current Cell.
 int[] getExportNetIDs(Export e)
          Get netIDs for the Export: e.
 int getNetID(Network net)
          Map any net inside the current cell to a net number.
 Netlist getNetlist()
          The Netlist of the current Cell.
 Network getNetworkInParent(Network network)
          Get the Network in the parent that connects to the specified Network in this cell.
 HierarchyEnumerator.CellInfo getParentInfo()
          Get the CellInfo for the current Cell's parent.
 Nodable getParentInst()
          Get the NodeInst that instantiates the Current instance.
 int[] getPortNetIDs(Nodable no, PortProto pp)
          Get the set of netIDs that are connected to the specified port of the specified Nodable.
 HierarchyEnumerator.CellInfo getRootInfo()
          Get the CellInfo for the root Cell
 java.awt.geom.AffineTransform getTransformToRoot()
          Method to get the transformation from the current location to the root.
 java.lang.String getUniqueNetName(int netID, java.lang.String sep)
          Get a unique, flat net name for the network.
 java.lang.String getUniqueNetName(Network net, java.lang.String sep)
          Get a unique, flat net name for the network.
 HierarchyEnumerator.NetNameProxy getUniqueNetNameProxy(int netID, java.lang.String sep)
          Same as getUniqueNetName except it returns a NameProxy instead of a String name
 HierarchyEnumerator.NetNameProxy getUniqueNetNameProxy(Network net, java.lang.String sep)
          Same as getUniqueNetName except it returns a NameProxy instead of a String name
 java.lang.String getUniqueNodableName(Nodable no, java.lang.String sep)
          Get a unique, flat instance name for the Nodable.
 HierarchyEnumerator.NodableNameProxy getUniqueNodableNameProxy(Nodable no, java.lang.String sep)
          Same as getUniqueNodableName except that it returns a NameProxy instead of a String name.
 boolean isRootCell()
          The Cell that is the root of the traversal
 HierarchyEnumerator.NetDescription netIdToNetDescription(int netID)
          Get the Network that is closest to the root in the design hierarchy that corresponds to netID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchyEnumerator.CellInfo

public HierarchyEnumerator.CellInfo()
Method Detail

getCell

public final Cell getCell()
The Cell currently being visited.


isRootCell

public final boolean isRootCell()
The Cell that is the root of the traversal


getContext

public final VarContext getContext()
The VarContext to use for evaluating all variables in the current Cell.


getNetlist

public final Netlist getNetlist()
The Netlist of the current Cell.


getParentInfo

public final HierarchyEnumerator.CellInfo getParentInfo()
Get the CellInfo for the current Cell's parent. If the current Cell is the root then return null.


getParentInst

public final Nodable getParentInst()
Get the NodeInst that instantiates the Current instance. If the current Cell is the root then return null.


getRootInfo

public final HierarchyEnumerator.CellInfo getRootInfo()
Get the CellInfo for the root Cell


getExportNetIDs

public final int[] getExportNetIDs(Export e)
Get netIDs for the Export: e.

Returns:
an array of net numbers.

getNetID

public final int getNetID(Network net)
Map any net inside the current cell to a net number. During the course of the traversal, all nets that map to the same net number are connected. Nets that map to different net numbers are disconnected.

If you want to generate a unique name for the net use getUniqueNetName().


getPortNetIDs

public final int[] getPortNetIDs(Nodable no,
                                 PortProto pp)
Get the set of netIDs that are connected to the specified port of the specified Nodable.


getUniqueNetName

public final java.lang.String getUniqueNetName(Network net,
                                               java.lang.String sep)
Get a unique, flat net name for the network. The network name will contain the hierarchical context as returned by VarContext.getInstPath() if it is not a top-level network.

Parameters:
sep - the context separator to use if needed.
Returns:
a unique String identifier for the network

getUniqueNetNameProxy

public final HierarchyEnumerator.NetNameProxy getUniqueNetNameProxy(Network net,
                                                                    java.lang.String sep)
Same as getUniqueNetName except it returns a NameProxy instead of a String name


getUniqueNetName

public final java.lang.String getUniqueNetName(int netID,
                                               java.lang.String sep)
Get a unique, flat net name for the network. The network name will contain the hierarchical context as returned by VarContext.getInstPath() if it is not a top-level network.

Parameters:
sep - the hierarchy separator to use if needed.
Returns:
a unique String identifier for the network

getUniqueNetNameProxy

public final HierarchyEnumerator.NetNameProxy getUniqueNetNameProxy(int netID,
                                                                    java.lang.String sep)
Same as getUniqueNetName except it returns a NameProxy instead of a String name


getUniqueNodableName

public final java.lang.String getUniqueNodableName(Nodable no,
                                                   java.lang.String sep)
Get a unique, flat instance name for the Nodable.

Parameters:
no -
sep - the hierarchy separator to use if needed
Returns:
a unique String identifer for the Nodable

getUniqueNodableNameProxy

public final HierarchyEnumerator.NodableNameProxy getUniqueNodableNameProxy(Nodable no,
                                                                            java.lang.String sep)
Same as getUniqueNodableName except that it returns a NameProxy instead of a String name.


netIdToNetDescription

public final HierarchyEnumerator.NetDescription netIdToNetDescription(int netID)
Get the Network that is closest to the root in the design hierarchy that corresponds to netID.


getNetworkInParent

public Network getNetworkInParent(Network network)
Get the Network in the parent that connects to the specified Network in this cell. Returns null if no network in parent connects to this network (i.e. network is not connected to export), or null if no parent.

Parameters:
network - the network in this cell
Returns:
the network in the parent that connects to the specified network, or null if no such network.

getTransformToRoot

public java.awt.geom.AffineTransform getTransformToRoot()
Method to get the transformation from the current location to the root. If this is at the top cell, the transformation is identity.

Returns:
the transformation from the current location to the root.