edu.byu.ece.edif.tools.replicate.nmr
Class EdifEnvironmentReplicate

java.lang.Object
  extended by edu.byu.ece.edif.tools.sterilize.lutreplace.EdifEnvironmentCopy
      extended by edu.byu.ece.edif.tools.replicate.nmr.EdifEnvironmentReplicate

public class EdifEnvironmentReplicate
extends EdifEnvironmentCopy

This class extends the EdifEnvironmentCopy to provide design replication. An entire EdifEnvironment is copied, but replicated copies are made where appropriate. Just as the EdifEnvironmentCopy class, the EdifEnvironmentReplicate class performs the replication/copy starting with the createEdifEnvironment() method (called from the replicate() method in this case). This starts a recursive call tree including calls to createTopCell, copyEdifCell, addEdifPorts, addChildEdifCellInstances, addChildEdifCellInstance, addNets, and addNet. A design that is replicated using this class may or may not be completely flattened. In any case, replication will occur only at the top-level. That is, cells that contain hierarchy will be replicated as an atomic unit. To make this work, the EdifEnvironmentReplicate class overrides the addEdifPorts, addChildEdifCellInstance, and addNet methods to do port, instance, and net replication if the cell being operated on is the top cell but call the super (EdifEnvironmentCopy) methods otherwise. The copyEdifCell method is also overridden to do what the super method would do then additionally maintain a port mapping needed for the wiring step (wiring is performed in addNet). Also, the copyEdifCell method calls the addOrgans method (if operating on the top cell) before getting to the addNets step. A getNewEdifCell(EdifCell) method has also been added to see if an EdifCell has already been copied to the new EdifEnvironment and return it if it has but copy and then return it if it hasn't.


Field Summary
protected  NMRArchitecture _arch
           
protected  ReplicationDescription _desc
           
protected  java.util.Map<EdifCellInstance,java.util.List<EdifCellInstance>> _instanceMap
           
protected  NetManager _netManager
           
protected  java.util.Map<EdifNet,java.util.List<EdifNet>> _netMap
           
protected  EdifCell _origTopCell
           
protected  java.util.Map<EdifPort,java.util.List<EdifPort>> _portMap
           
protected  EdifNameable _topCellName
           
 
Fields inherited from class edu.byu.ece.edif.tools.sterilize.lutreplace.EdifEnvironmentCopy
_cellMap, _libMap, _newEnv, _origEnv
 
Constructor Summary
EdifEnvironmentReplicate(EdifEnvironment oldEnvironment, ReplicationDescription desc, NMRArchitecture arch)
           
EdifEnvironmentReplicate(EdifEnvironment oldEnvironment, ReplicationDescription desc, NMRArchitecture arch, EdifNameable topCellName)
           
 
Method Summary
protected  void addChildEdifCellInstance(EdifCell origCell, EdifCell newCell, EdifCellInstance oldInstance)
          Either replicate the given instance in the new design (if operating in the top cell) or copy it over exactly.
protected  void addDetectionWiring(EdifCell newCell)
          Add the circuitry for merging the detection signals into the specified output(s).
protected  void addEdifPorts(EdifCell origCell, EdifCell newCell)
          Either replicate the ports of the cell in the new design (if operating on the top cell) or copy ports over exactly.
protected  EdifNet addNet(EdifCell origCell, EdifCell newCell, EdifNet oldNet)
          Either wire replicated instances according to the wiring algorithm and WiringPolicies specified in the ReplicationDescription (if working in the top cell) or copy nets exactly.
protected  void addOrgans(EdifCell newTopCell)
          Add organs specified by ReplicationDescription
 EdifCell copyEdifCell(EdifCell origCell, EdifLibrary destLibrary, EdifNameable name)
          Do the same things as the super (EdifEnvironmentCopy) method but also maintain a port mapping of old to new ports.
protected  EdifCell getNewEdifCell(EdifCell oldCell)
          This method will get the EdifCell in the new EdifEnvironment that corresponds to the given EdifCell from the old EdifEnvironment.
 void printDomainReport(java.lang.String fileName)
           
 EdifEnvironment replicate()
          Perform the replication specified by the ReplicationDescription given in the constructor.
 
Methods inherited from class edu.byu.ece.edif.tools.sterilize.lutreplace.EdifEnvironmentCopy
addChildEdifCellInstances, addEdifPortRef, addNets, copyEdifCell, copyEdifCell, copyEdifLibrary, copyEdifLibrary, createEdifEnvironment, createEdifEnvironment, createTopCell, createTopDesign, getNewEnvironment, setEdifEnvironmentDateAuthorProgramVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_arch

protected NMRArchitecture _arch

_desc

protected ReplicationDescription _desc

_origTopCell

protected EdifCell _origTopCell

_instanceMap

protected java.util.Map<EdifCellInstance,java.util.List<EdifCellInstance>> _instanceMap

_netMap

protected java.util.Map<EdifNet,java.util.List<EdifNet>> _netMap

_portMap

protected java.util.Map<EdifPort,java.util.List<EdifPort>> _portMap

_netManager

protected NetManager _netManager

_topCellName

protected EdifNameable _topCellName
Constructor Detail

EdifEnvironmentReplicate

public EdifEnvironmentReplicate(EdifEnvironment oldEnvironment,
                                ReplicationDescription desc,
                                NMRArchitecture arch)
                         throws EdifNameConflictException
Throws:
EdifNameConflictException

EdifEnvironmentReplicate

public EdifEnvironmentReplicate(EdifEnvironment oldEnvironment,
                                ReplicationDescription desc,
                                NMRArchitecture arch,
                                EdifNameable topCellName)
                         throws EdifNameConflictException
Throws:
EdifNameConflictException
Method Detail

replicate

public EdifEnvironment replicate()
                          throws EdifNameConflictException
Perform the replication specified by the ReplicationDescription given in the constructor.

Returns:
Throws:
EdifNameConflictException

addChildEdifCellInstance

protected void addChildEdifCellInstance(EdifCell origCell,
                                        EdifCell newCell,
                                        EdifCellInstance oldInstance)
                                 throws EdifNameConflictException
Either replicate the given instance in the new design (if operating in the top cell) or copy it over exactly.

Overrides:
addChildEdifCellInstance in class EdifEnvironmentCopy
Throws:
EdifNameConflictException

addEdifPorts

protected void addEdifPorts(EdifCell origCell,
                            EdifCell newCell)
                     throws EdifNameConflictException
Either replicate the ports of the cell in the new design (if operating on the top cell) or copy ports over exactly.

Overrides:
addEdifPorts in class EdifEnvironmentCopy
Throws:
EdifNameConflictException

addNet

protected EdifNet addNet(EdifCell origCell,
                         EdifCell newCell,
                         EdifNet oldNet)
                  throws EdifNameConflictException
Either wire replicated instances according to the wiring algorithm and WiringPolicies specified in the ReplicationDescription (if working in the top cell) or copy nets exactly.

Overrides:
addNet in class EdifEnvironmentCopy
Throws:
EdifNameConflictException

addDetectionWiring

protected void addDetectionWiring(EdifCell newCell)
Add the circuitry for merging the detection signals into the specified output(s).


addOrgans

protected void addOrgans(EdifCell newTopCell)
Add organs specified by ReplicationDescription

Parameters:
newTopCell -

copyEdifCell

public EdifCell copyEdifCell(EdifCell origCell,
                             EdifLibrary destLibrary,
                             EdifNameable name)
                      throws EdifNameConflictException
Do the same things as the super (EdifEnvironmentCopy) method but also maintain a port mapping of old to new ports. Create the NetManager that will be used in the wiring algorithm if this is the top cell. Also, call the addOrgans method if operating on the top cell.

Overrides:
copyEdifCell in class EdifEnvironmentCopy
Throws:
EdifNameConflictException

getNewEdifCell

protected EdifCell getNewEdifCell(EdifCell oldCell)
                           throws EdifNameConflictException
This method will get the EdifCell in the new EdifEnvironment that corresponds to the given EdifCell from the old EdifEnvironment. It does so by first checking to see if the given old cell has already been copied (_cellMap) and returning the new copy if it has. If the given cell has not already been copied, a copy is made and the copy is returned. The intention is that the copyEdifCell method not be used directly -- this will ensure that we don't accidently create duplicate copies of the same cell and at the same time only copy the cells that are actually needed in the new environment.

Parameters:
oldCell -
Returns:
Throws:
EdifNameConflictException

printDomainReport

public void printDomainReport(java.lang.String fileName)
                       throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException