edu.byu.ece.edif.tools.sterilize.lutreplace
Class BasicReplacementContext

java.lang.Object
  extended by edu.byu.ece.edif.tools.sterilize.lutreplace.BasicReplacementContext
All Implemented Interfaces:
ReplacementContext
Direct Known Subclasses:
HalfLatchReplacementContext, TemplateCellReplacementContext

public class BasicReplacementContext
extends java.lang.Object
implements ReplacementContext


Field Summary
protected  EdifCell _newParentCell
           
protected  EdifCellInstance _oldInstanceToReplace
           
protected  java.util.HashMap<EdifSingleBitPort,EdifNet> _oldSBPortNewNetMap
           
 
Constructor Summary
BasicReplacementContext(EdifCell newParent, EdifCellInstance oldInstance)
           
 
Method Summary
 void addOldSBPortNewNetAssociation(EdifSingleBitPort oldSBPort, EdifNet newNet)
           
 EdifNet getNewNetToConnect(EdifSingleBitPort oldPort)
          This method will provide the "new" net that was created in the new EdifCell That would have otherwise been hooked up to the given Port if replacement did not occur.
 EdifNet getNewNetToConnect(java.lang.String portName)
          Return the new net.
 EdifNet getNewNetToConnect(java.lang.String portName, int bitNum)
          This method will provide the "new" net that was created in the new EdifCell that would have otherwise been hooked up to the given port.
 EdifCell getNewParentCell()
           
 EdifCell getOldCellToReplace()
          Returns the EdifCell in the old environment that is being replaced.
 EdifCellInstance getOldInstanceToReplace()
          Returns the EdifCellInstance in the old design that needs to be replaced This provides the replacer with any property information (such as INIT)
 java.util.Collection<EdifSingleBitPort> getOldSBPorts()
           
protected  EdifSingleBitPort getOldSingleBitPort(java.lang.String portName, int bitNum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_oldInstanceToReplace

protected EdifCellInstance _oldInstanceToReplace

_oldSBPortNewNetMap

protected java.util.HashMap<EdifSingleBitPort,EdifNet> _oldSBPortNewNetMap

_newParentCell

protected EdifCell _newParentCell
Constructor Detail

BasicReplacementContext

public BasicReplacementContext(EdifCell newParent,
                               EdifCellInstance oldInstance)
Method Detail

getNewParentCell

public EdifCell getNewParentCell()
Specified by:
getNewParentCell in interface ReplacementContext
Returns:
the new EdifCell where the replacement logic should be added. This EdifCell is needed so that new logic can be added.

getNewNetToConnect

public EdifNet getNewNetToConnect(EdifSingleBitPort oldPort)
Description copied from interface: ReplacementContext
This method will provide the "new" net that was created in the new EdifCell That would have otherwise been hooked up to the given Port if replacement did not occur. The replacer should use this net and hook it up to the new appropriate port. Note that the arguments are the "old" single bit port (i.e. the port in the old cell, not the new cell).

Specified by:
getNewNetToConnect in interface ReplacementContext

addOldSBPortNewNetAssociation

public void addOldSBPortNewNetAssociation(EdifSingleBitPort oldSBPort,
                                          EdifNet newNet)
Specified by:
addOldSBPortNewNetAssociation in interface ReplacementContext

getNewNetToConnect

public EdifNet getNewNetToConnect(java.lang.String portName,
                                  int bitNum)
Description copied from interface: ReplacementContext
This method will provide the "new" net that was created in the new EdifCell that would have otherwise been hooked up to the given port. The port list of the old cell type will be searched using the given port name. The bit number of the port will be determined by the bitNum parameter. If a port does not exist with the given name or there is no single bit port with the given bit number then method will return a null.

Specified by:
getNewNetToConnect in interface ReplacementContext

getOldCellToReplace

public EdifCell getOldCellToReplace()
Description copied from interface: ReplacementContext
Returns the EdifCell in the old environment that is being replaced.

Specified by:
getOldCellToReplace in interface ReplacementContext

getOldInstanceToReplace

public EdifCellInstance getOldInstanceToReplace()
Description copied from interface: ReplacementContext
Returns the EdifCellInstance in the old design that needs to be replaced This provides the replacer with any property information (such as INIT)

Specified by:
getOldInstanceToReplace in interface ReplacementContext

getNewNetToConnect

public EdifNet getNewNetToConnect(java.lang.String portName)
Description copied from interface: ReplacementContext
Return the new net. Assumes a "0" bit number. Will return a null if the string does not exist.

Specified by:
getNewNetToConnect in interface ReplacementContext

getOldSingleBitPort

protected EdifSingleBitPort getOldSingleBitPort(java.lang.String portName,
                                                int bitNum)

getOldSBPorts

public java.util.Collection<EdifSingleBitPort> getOldSBPorts()
Specified by:
getOldSBPorts in interface ReplacementContext