hades.utils
Class DesignHierarchyNavigator

java.lang.Object
  extended byhades.utils.DesignHierarchyNavigator

public class DesignHierarchyNavigator
extends java.lang.Object

DesignHierarchyNavigator - utility class to access SimObject and Signal objects efficiently via hierarchical names. This class uses internal hashtables to cache and speedup accesses. Note that it is legal (if bad style) to use the same name for both simobjects and signals in one design.


Constructor Summary
DesignHierarchyNavigator(Design design)
          create a new DesignHierarchyNavigator for the specified 'current working' Design.
 
Method Summary
 Design findLeafDesign(java.lang.String[] tokens)
          find the leaf design specified by the tokens[] hierarchy names.
static Design findRootDesign(Design design)
          traverse the sub-Design hierarchy up and return the root Design (if any).
 Signal findSignal(java.lang.String name)
          return the specified Signal or null, where "name" can be either a relative name or a fully qualified name.
 SimObject findSimObject(java.lang.String name)
           
 boolean isQualifiedName(java.lang.String name)
          check whether "name" is a fully qualified name, that is, whether "name" starts with a leading slash character.
static void main(java.lang.String[] argv)
          main: simple DesignHierarchyNavigator selftest.
 java.lang.String[] tokenizeName(java.lang.String name)
          split a fully qualified, hiearchical name using '/' slash chars as separators into the individual tokens.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesignHierarchyNavigator

public DesignHierarchyNavigator(Design design)
create a new DesignHierarchyNavigator for the specified 'current working' Design. This Design object is used when using "relative" names.

Method Detail

findRootDesign

public static Design findRootDesign(Design design)
traverse the sub-Design hierarchy up and return the root Design (if any).


findLeafDesign

public Design findLeafDesign(java.lang.String[] tokens)
find the leaf design specified by the tokens[] hierarchy names. For example, given the tokens { "uut", "adder32", "cla8", "fulladder5", "carryout" }, this method returns a reference to the "fulladder5" subdesign.


findSignal

public Signal findSignal(java.lang.String name)
return the specified Signal or null, where "name" can be either a relative name or a fully qualified name.


findSimObject

public SimObject findSimObject(java.lang.String name)

tokenizeName

public java.lang.String[] tokenizeName(java.lang.String name)
split a fully qualified, hiearchical name using '/' slash chars as separators into the individual tokens. For example, the name "/uut/adder32/cla8/fulladder/carryout" is split into { "uut", "adder32", "cla8", "fulladder5", "carryout" }


isQualifiedName

public boolean isQualifiedName(java.lang.String name)
check whether "name" is a fully qualified name, that is, whether "name" starts with a leading slash character.


main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
main: simple DesignHierarchyNavigator selftest.

Throws:
java.lang.Exception