edu.byu.ece.edif.tools.flatten
Class PreservedHierarchyByNames

java.lang.Object
  extended by edu.byu.ece.edif.tools.flatten.PreservedHierarchyByNames
All Implemented Interfaces:
java.io.Serializable

public class PreservedHierarchyByNames
extends java.lang.Object
implements java.io.Serializable

The purpose of this class is to keep track of the hierarchy that used to exist in a design before flattening. It is designed to do so without the need for references to actual EdifCell, EdifCellInstance, EdifNet, etc. objects. Instead it keeps track of the names of the objects in the flattened design and their mapping from the original design hierarchy. The class has three main object references: the top InstanceNode from the FlattenedEdifCell (this keeps track of all the hierarchy in terms of original names of cells/instances/nets in a tree made up of HierarchicalInstances and HierarchicalNets), a Map (this keeps a mapping from InstanceNodes to names of instances in the new, flattened design), and a Map (this keeps a mapping from HierarchicalNets to the name of the net in the new, flattened design to which each HierarchicalNet corresponds). By using only name references, this class makes it possible for hierarchy information to be preserved even after an EdifEnvironment goes through a transformation such as SRL replacement or half-latch removal (in these cases, the EdifEnvironment is copied so object references don't match up which is why name references are needed)

Author:
jonjohn
See Also:
Serialized Form

Field Summary
protected  HierarchyNaming _hierarchyNaming
           
protected  java.util.Map<HierarchicalInstance,java.lang.String> _instanceNameMap
           
protected  java.util.Map<HierarchicalNet,java.lang.String> _netNameMap
           
protected  HierarchicalInstance _topNode
           
 
Constructor Summary
PreservedHierarchyByNames(FlattenedEdifCell flatCell)
           
 
Method Summary
 EdifCellInstance getFlatInstance(HierarchicalInstance hInstance, EdifCell flatCell)
           
 EdifCellInstance getFlatInstance(java.lang.String hierarchicalName, EdifCell flatCell)
           
 java.lang.String getFlatInstanceName(HierarchicalInstance hInstance)
           
 java.lang.String getFlatInstanceName(java.lang.String hierarchicalName)
           
 EdifNet getFlatNet(HierarchicalNet hNet, EdifCell flatCell)
           
 EdifNet getFlatNet(java.lang.String hierarchicalName, EdifCell flatCell)
           
 java.lang.String getFlatNetName(HierarchicalNet hNet)
           
 java.lang.String getFlatNetName(java.lang.String hierarchicalName)
           
 HierarchicalInstance getHierarchicalInstance(java.lang.String hierarchicalName)
           
 HierarchicalNet getHierarchicalNet(java.lang.String hierarchicalName)
           
 java.util.Collection<EdifCellInstance> getInstancesWithin(java.lang.String hierarchicalName, EdifCell flatCell)
           
 java.util.Collection<EdifCellInstance> getInstancesWithinCellTypes(java.util.Collection<java.lang.String> cellTypes, EdifCell topCell)
           
protected  java.util.Collection<EdifCellInstance> getInstancesWithinNode(HierarchicalInstance instanceNode, EdifCell topCell)
          Given a HierarchicalInstance node, get a Collection of FlattenedEdifCellInstances that are leaf instances that would be "within" the original instance associated with the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_topNode

protected HierarchicalInstance _topNode

_instanceNameMap

protected java.util.Map<HierarchicalInstance,java.lang.String> _instanceNameMap

_netNameMap

protected java.util.Map<HierarchicalNet,java.lang.String> _netNameMap

_hierarchyNaming

protected HierarchyNaming _hierarchyNaming
Constructor Detail

PreservedHierarchyByNames

public PreservedHierarchyByNames(FlattenedEdifCell flatCell)
Method Detail

getFlatInstanceName

public java.lang.String getFlatInstanceName(HierarchicalInstance hInstance)

getFlatInstance

public EdifCellInstance getFlatInstance(HierarchicalInstance hInstance,
                                        EdifCell flatCell)

getFlatInstanceName

public java.lang.String getFlatInstanceName(java.lang.String hierarchicalName)

getFlatInstance

public EdifCellInstance getFlatInstance(java.lang.String hierarchicalName,
                                        EdifCell flatCell)

getHierarchicalInstance

public HierarchicalInstance getHierarchicalInstance(java.lang.String hierarchicalName)

getFlatNetName

public java.lang.String getFlatNetName(HierarchicalNet hNet)

getFlatNet

public EdifNet getFlatNet(HierarchicalNet hNet,
                          EdifCell flatCell)

getFlatNetName

public java.lang.String getFlatNetName(java.lang.String hierarchicalName)

getFlatNet

public EdifNet getFlatNet(java.lang.String hierarchicalName,
                          EdifCell flatCell)

getHierarchicalNet

public HierarchicalNet getHierarchicalNet(java.lang.String hierarchicalName)

getInstancesWithin

public java.util.Collection<EdifCellInstance> getInstancesWithin(java.lang.String hierarchicalName,
                                                                 EdifCell flatCell)

getInstancesWithinNode

protected java.util.Collection<EdifCellInstance> getInstancesWithinNode(HierarchicalInstance instanceNode,
                                                                        EdifCell topCell)
Given a HierarchicalInstance node, get a Collection of FlattenedEdifCellInstances that are leaf instances that would be "within" the original instance associated with the node.

Parameters:
instanceNode - the HierarchicalInstance node corresponding to an original instance
Returns:
a Collection of FlattenedEdifCellInstances that correspond to original instances "within" the instance associated with the given HierarchicalInstance node

getInstancesWithinCellTypes

public java.util.Collection<EdifCellInstance> getInstancesWithinCellTypes(java.util.Collection<java.lang.String> cellTypes,
                                                                          EdifCell topCell)