edu.byu.ece.edif.tools.sterilize.halflatch
Class EdifHalfLatchRemover

java.lang.Object
  extended by edu.byu.ece.edif.tools.sterilize.halflatch.EdifHalfLatchRemover
Direct Known Subclasses:
SequentialEdifHalfLatchRemover, TopologicalEdifHalfLatchRemover

public abstract class EdifHalfLatchRemover
extends java.lang.Object

Since:
Created on Oct 27, 2005

Field Summary
protected  int _constantSinkThreshold
           
protected static boolean _debug
           
protected  HalfLatchArchitecture _hlArchitecture
           
protected  int _safeConstantPolarity
           
protected  java.lang.String _topLevelSafePortName
           
protected  boolean _usePortForConstant
           
static int DEFAULT_SAFE_CONSTANT_POLARITY
           
static boolean DEFAULT_USE_PORT_FOR_CONSTANT_BOOL
           
 
Constructor Summary
EdifHalfLatchRemover(HalfLatchArchitecture hlArchitecture, int safeConstantPolarity, boolean usePortForConstant)
           
EdifHalfLatchRemover(HalfLatchArchitecture hlArchitecture, int safeConstantPolarity, boolean usePortForConstant, java.lang.String safeConstantPortName)
           
 
Method Summary
static EdifCell convertCelltoHalfLatchCellDeep(EdifCell cellToConvert, EdifLibrary targetLib, EdifLibraryManager elm, HalfLatchArchitecture hlArchitecture, int safeConstantPolarity)
          Recursively copy an EdifCell from one EdifLibraryManager to another.
protected abstract  void fixPotentialHalfLatchesInEachCell(EdifEnvironment environment)
           
private static java.lang.String getUsage()
           
static void main(java.lang.String[] args)
           
 EdifEnvironment removeHalfLatches(EdifEnvironment environment)
          General algorithm as developed by Keith Morgan, Nathan Rollins, Brian Pratt & Dr.
 HalfLatchFlattenedEdifCell removeHalfLatches(FlattenedEdifCell flatCell)
           
protected  void setTopDesignAndInstance(EdifEnvironment new_env, HalfLatchEdifCell hl_top_cell, EdifEnvironment environment)
          Creates a new EdifDesign in the new environment (copying the properties of the old EdifDesign) and setting the top cell to be the top instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAFE_CONSTANT_POLARITY

public static final int DEFAULT_SAFE_CONSTANT_POLARITY
See Also:
Constant Field Values

DEFAULT_USE_PORT_FOR_CONSTANT_BOOL

public static final boolean DEFAULT_USE_PORT_FOR_CONSTANT_BOOL
See Also:
Constant Field Values

_debug

protected static final boolean _debug
See Also:
Constant Field Values

_hlArchitecture

protected HalfLatchArchitecture _hlArchitecture

_safeConstantPolarity

protected int _safeConstantPolarity

_usePortForConstant

protected boolean _usePortForConstant

_topLevelSafePortName

protected java.lang.String _topLevelSafePortName

_constantSinkThreshold

protected int _constantSinkThreshold
Constructor Detail

EdifHalfLatchRemover

public EdifHalfLatchRemover(HalfLatchArchitecture hlArchitecture,
                            int safeConstantPolarity,
                            boolean usePortForConstant)

EdifHalfLatchRemover

public EdifHalfLatchRemover(HalfLatchArchitecture hlArchitecture,
                            int safeConstantPolarity,
                            boolean usePortForConstant,
                            java.lang.String safeConstantPortName)
Parameters:
hlArchitecture - Object which holds all of the architecture specific information
safeConstantPolarity - Polarity of the main safe-constant signal running around in the design
usePortForConstant - Boolean which determines whether or not the safe-constant network is driven through a port or internal constant generator cells
safeConstantPortName - The name of the port to use for the safe constant.
Method Detail

removeHalfLatches

public HalfLatchFlattenedEdifCell removeHalfLatches(FlattenedEdifCell flatCell)

removeHalfLatches

public EdifEnvironment removeHalfLatches(EdifEnvironment environment)
General algorithm as developed by Keith Morgan, Nathan Rollins, Brian Pratt & Dr. Wirthlin

Note: Multiple passes are for simplicity in the algorithms and to reduce processing time.

Step 1 / Pass 1

For each cell in design libraries

  1. Create a new HalfLatchEdifCell version of non-primitive cells (This class simply extends EdifCell and is a convenience class to easily create and get the 'safe constant' ports, nets, inverters, etc...)
End For

Step 2 / Pass 2

For each cell in design libraries

  1. Remove the half-latches and constants in that cell. (This is the abstract method for this class and is currently implemented in a Sequential or Topological fashion. Each has different options.)
end For

Step 3

  1. If the user does not want to use a port for the 'safe constant'...
    • create a safe constant generating element in the top cell (like an all-0 LUT)
  2. Otherwise keep the port on the top-level cell for the 'safe-constant'
    • buffer the top-level 'safe constant' port

Step 4

Make sure the edif that will be written will put the cells in correct declaration order.

Parameters:
environment - Container of objects relating to the design which is being modified
Returns:
A new environment (Edif design) which had half-latches removed

setTopDesignAndInstance

protected void setTopDesignAndInstance(EdifEnvironment new_env,
                                       HalfLatchEdifCell hl_top_cell,
                                       EdifEnvironment environment)
Creates a new EdifDesign in the new environment (copying the properties of the old EdifDesign) and setting the top cell to be the top instance.

Parameters:
new_env - The new EdifEnvironment created
hl_top_cell - The top-level EdifCell
environment - The old EdifEnvironment to copy properties from

convertCelltoHalfLatchCellDeep

public static EdifCell convertCelltoHalfLatchCellDeep(EdifCell cellToConvert,
                                                      EdifLibrary targetLib,
                                                      EdifLibraryManager elm,
                                                      HalfLatchArchitecture hlArchitecture,
                                                      int safeConstantPolarity)
Recursively copy an EdifCell from one EdifLibraryManager to another. During the copy, cells (instanced by the cell to be copied) may be added to other libraries within the EdifLibraryManager.

Parameters:
cellToConvert - the EdifCell object to copy
targetLib - the EdifLibrary to copy the cell into. If no EdifLibrary is specified (null), the EdifCell will be placed in an EdifLibrary with the same name (or a new unique name if there is a clash) as it's old EdifLibrary
elm - the EdifLibraryManager to copy the cell into
Returns:
a reference to the new copy of the EdifCell object

fixPotentialHalfLatchesInEachCell

protected abstract void fixPotentialHalfLatchesInEachCell(EdifEnvironment environment)

main

public static void main(java.lang.String[] args)
Parameters:
args -

getUsage

private static java.lang.String getUsage()