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

java.lang.Object
  extended by edu.byu.ece.edif.core.NamedPropertyObject
      extended by edu.byu.ece.edif.core.EdifCell
          extended by edu.byu.ece.edif.tools.flatten.FlattenedEdifCellLite
All Implemented Interfaces:
EdifOut, Properties, Trimable, java.io.Serializable

public class FlattenedEdifCellLite
extends EdifCell

Represents a flattened EdifCell object; that is, an EdifCell with no subcells, composed entirely of primitives. This class will create a new flattened EdifCell object during construction that represents a flattened version of the original EdifCell passed into the constructor. This class maintains associations between instances in the flattened cell to the corresponding instances in the original cell.

This class also contains a main function which can be used to create a new flattened EDIF netlist of any given cell.

TODO:

Version:
$Id:FlattenedEdifCellLite.java 130 2008-03-31 16:23:42Z jamesfcarroll $
Author:
Mike Wirthlin
See Also:
Serialized Form

Field Summary
protected  java.util.Map _newOldInstanceMap
          A Map between EdifCellInstances in the new flattened EdifCell and the corresponding EdifCellInstance in the original non-flattened EdifCell.
protected  java.util.Map _newOldNetMap
          A Map between EdifNet objects in the new flattened EdifCell and the corresponding EdifNet in the original non-flattened EdifCell.
protected  EdifCell _origCell
          The original, non-flattened EdifCell used to create this flattened EdifCell.
private static boolean debug
           
 
Fields inherited from class edu.byu.ece.edif.core.EdifCell
serialVersionUID
 
Constructor Summary
FlattenedEdifCellLite(EdifCell cell)
           
FlattenedEdifCellLite(EdifLibrary lib, EdifCell cell)
           
 
Method Summary
protected  EdifNet createNewNet(EdifNet oldNet)
          Create a new EdifNet object in the flattened hierarchy that corresponds to a net in the original hierarchical circuit.
protected  java.util.Collection descend_top(EdifCell origCell, java.util.Map<EdifSingleBitPort,EdifNet> portNetMap)
          This method recursively inserts the contents of each cell instance of the origCell into the cell.
protected  void flatten_top()
          This method will create the new flattened circuit.
static FlattenedEdifCellLite getFlatCell(java.lang.String[] args)
           
 EdifCell getOriginalCell()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class edu.byu.ece.edif.core.EdifCell
addBlackBoxResource, addNet, addPort, addPort, addPortUniqueName, addPortUniqueName, addSubCell, addSubCellUniqueName, cellInstanceIterator, contains, contains, contains, copyCellInternals, deleteNet, deletePort, deleteSubCell, deleteSubCell, equalsInterface, equalsName, findCellInstancesOf, getBlackBoxResources, getCellInstance, getCellInstanceList, getDanglingNets, getDanglingNets, getHierarchicalPrimitiveList, getInnerCells, getInputPorts, getInstance, getInstancedCellTypes, getInstancePortNet, getInterface, getLibrary, getMatchingPort, getNet, getNetList, getOutputPorts, getPort, getPortList, getPortRefs, getSafeCellInstanceList, getSortedNetList, getSortedPortList, getSortedPropertyList, getSortedSubCellList, getSubCellList, getUnconnectedInnerPorts, getUnconnectedInstances, getUnconnectedOuterPorts, getUniqueInstanceNameable, getUniqueInstanceNameable, getUniqueNetNameable, getUniqueNetNameable, isBlackBox, isFlat, isLeafCell, isPrimitive, modifyCellType, netListIterator, setInterface, setPrimitive, tagAsPrimitive, toEdif, toString, trimToSize
 
Methods inherited from class edu.byu.ece.edif.core.NamedPropertyObject
addProperty, addProperty, addPropertyList, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

private static boolean debug

_origCell

protected EdifCell _origCell
The original, non-flattened EdifCell used to create this flattened EdifCell.


_newOldNetMap

protected java.util.Map _newOldNetMap
A Map between EdifNet objects in the new flattened EdifCell and the corresponding EdifNet in the original non-flattened EdifCell. Note that a single new EdifNet may correspond to multiple EdifNet objects. This Map will record only one.


_newOldInstanceMap

protected java.util.Map _newOldInstanceMap
A Map between EdifCellInstances in the new flattened EdifCell and the corresponding EdifCellInstance in the original non-flattened EdifCell.

Constructor Detail

FlattenedEdifCellLite

public FlattenedEdifCellLite(EdifCell cell)
                      throws EdifNameConflictException,
                             InvalidEdifNameException
Throws:
EdifNameConflictException
InvalidEdifNameException

FlattenedEdifCellLite

public FlattenedEdifCellLite(EdifLibrary lib,
                             EdifCell cell)
                      throws EdifNameConflictException,
                             InvalidEdifNameException
Throws:
EdifNameConflictException
InvalidEdifNameException
Method Detail

getOriginalCell

public EdifCell getOriginalCell()
Returns:
the original, non-flattened EdifCell used to create this flattened EdifCell.

createNewNet

protected EdifNet createNewNet(EdifNet oldNet)
Create a new EdifNet object in the flattened hierarchy that corresponds to a net in the original hierarchical circuit.

Parameters:
oldNet - Original net in _origCell
Returns:
New EdifNet object in this EdifCell

flatten_top

protected void flatten_top()
This method will create the new flattened circuit. This is called by the constructor. This method will perform a number of tasks related to the top-level cell and then recursively call descend_top.


descend_top

protected java.util.Collection descend_top(EdifCell origCell,
                                           java.util.Map<EdifSingleBitPort,EdifNet> portNetMap)
This method recursively inserts the contents of each cell instance of the origCell into the cell.

Parameters:
portNetMap - Key: EdifSingleBitPort (each single-bit port of the entire cell interface is included as a key). Value: new flattened EdifNet This map lets the method know which nets are already connected to the cell top-level ports.

getFlatCell

public static FlattenedEdifCellLite getFlatCell(java.lang.String[] args)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException