edu.byu.ece.edif.arch.xilinx
Class InstanceHierarchy

java.lang.Object
  extended by edu.byu.ece.edif.arch.xilinx.InstanceHierarchy

public class InstanceHierarchy
extends java.lang.Object

This class represents an EdifCellInstance object within a hierarchy framework. This is a tree data structure with a reference to the parent branch (if not the root) and an array of the children representing each child branch. The top node in this tree is the top-level of the hierarchy. An instance in the hierarchy includes the following:

TODO: Move this to edu.byu.ece.edif.core.hierarchy Rename to EDIFInstanceHierarchy

Since:
Created on Jun 30, 2005

Field Summary
protected  InstanceHierarchy[] _children
           
protected  NetHierarchy[] _nets
          A collection of NetHierarchy objects that correspond to this instance.
protected  InstanceHierarchy _parent
          The parent instance of this instance.
protected  EdifCellInstance _self
          The corresponding EdifCellInstance object of this instance.
 
Constructor Summary
InstanceHierarchy(EdifCellInstance self)
          Create a top-level hierarchical instance.
InstanceHierarchy(InstanceHierarchy parent, EdifCellInstance self)
          Creates a new hierarchical element.
InstanceHierarchy(InstanceHierarchy parent, EdifCellInstance self, boolean record_nets)
           
 
Method Summary
static InstanceHierarchy findInstance(InstanceHierarchy hier, EdifCellInstance eci)
           
 InstanceHierarchy[] getChildren()
           
 InstanceHierarchy getHierarchyNode(java.util.ArrayList cells)
           
 EdifCell getInstanceCellType()
          Determine EdifCell type of the EdifCellInstance at this level in the hierarchy.
 java.lang.String getInstanceName()
          Create a unique name for this instance that includes the hierarchy information.
 java.lang.String getInstanceName(boolean printTop)
           
 java.lang.String getInstanceName(boolean printTop, java.lang.String hierarchy_separation_string)
           
 NetHierarchy[] getNets()
           
 InstanceHierarchy getParent()
           
 EdifCellInstance getSelf()
           
 java.util.Iterator getUpIterator()
          Returns an iterator of InstanceHierachy objects going "up" the hierarchy through parents.
 boolean isTop()
           
 boolean isTop(boolean includeTop)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_parent

protected InstanceHierarchy _parent
The parent instance of this instance. This will be null if the instance is the top level.


_self

protected EdifCellInstance _self
The corresponding EdifCellInstance object of this instance.


_nets

protected NetHierarchy[] _nets
A collection of NetHierarchy objects that correspond to this instance.


_children

protected InstanceHierarchy[] _children
Constructor Detail

InstanceHierarchy

public InstanceHierarchy(EdifCellInstance self)
Create a top-level hierarchical instance.

Parameters:
self -

InstanceHierarchy

public InstanceHierarchy(InstanceHierarchy parent,
                         EdifCellInstance self)
Creates a new hierarchical element.

Parameters:
parent - Parent EdifCellInstance object in the hierarchy
self - The EdifCellInstance represented by this hierarchical object. TODO: provide option for ignoring nets (if interested only in instance hierarchy).

InstanceHierarchy

public InstanceHierarchy(InstanceHierarchy parent,
                         EdifCellInstance self,
                         boolean record_nets)
Method Detail

findInstance

public static InstanceHierarchy findInstance(InstanceHierarchy hier,
                                             EdifCellInstance eci)

getHierarchyNode

public InstanceHierarchy getHierarchyNode(java.util.ArrayList cells)

getChildren

public InstanceHierarchy[] getChildren()

getInstanceCellType

public EdifCell getInstanceCellType()
Determine EdifCell type of the EdifCellInstance at this level in the hierarchy.

Returns:

getNets

public NetHierarchy[] getNets()

getParent

public InstanceHierarchy getParent()
Returns:
The parent InstanceHierarchy of the object.

getSelf

public EdifCellInstance getSelf()

getUpIterator

public java.util.Iterator getUpIterator()
Returns an iterator of InstanceHierachy objects going "up" the hierarchy through parents.

Returns:

isTop

public boolean isTop()

isTop

public boolean isTop(boolean includeTop)

getInstanceName

public java.lang.String getInstanceName()
Create a unique name for this instance that includes the hierarchy information. This method uses the "oldname" (if it exists) and separates the levels of hierarchy by the "/" character.


getInstanceName

public java.lang.String getInstanceName(boolean printTop)

getInstanceName

public java.lang.String getInstanceName(boolean printTop,
                                        java.lang.String hierarchy_separation_string)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object