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

java.lang.Object
  extended by edu.byu.ece.edif.tools.sterilize.halflatch.EdifTools

public class EdifTools
extends java.lang.Object

This class contains tools used by the Half Latch Removal classes. Most of these were modified from various EDIF classes to work in special cases. Many could be added to the EDIF base classes in the future.


Field Summary
private static int debug_level
           
 
Constructor Summary
EdifTools()
           
 
Method Summary
static void cleanUpCell(EdifCell cell)
          Removes all dangling Nets and unconnected CellInstances from the passed EdifCell.
static java.util.Collection getAttachedNets(EdifCell cell, EdifCellInstance inst)
          This method will iterate through all of the nets in cell and return those nets that are connected to inst.
static EdifNet getInstancePortNet(EdifCell cell, EdifCellInstance instance, EdifPort port, int bit)
          FROM EDIFCELL - MODIFIED TO WORK WITH MULTI-BIT EDIFPORTS This method will return the EdifNet that is connected to the given port on the given instance.
static EdifNet getInstancePortNet(EdifCell cell, EdifCellInstance instance, EdifSingleBitPort port)
           
static EdifNet getOuterNet(EdifCell cell, EdifCellInstance eci, EdifPort port)
           
static EdifNet getOuterNet(EdifCell cell, EdifCellInstance eci, EdifPort port, int portBit)
          This method will return the EdifNet that connects to the given EdifPort BIT of the given EdifCellInstance in the given EdifCell
static EdifPortRef getPortRef(EdifCell cell, EdifPort port)
          FROM EDIFCELLINSTANCE - MODIFIED TO WORK ON AN EDIFCELL INSTEAD Returns the port ref that refers to the passed-in EdifPort.
static boolean isAttached(EdifNet net, EdifCellInstance cell)
          FROM EDIFNET - MODIFIED TO COMPARE CELL INSTANCE NAMES INSTEAD OF CELL INSTANCE OBJECTS
static boolean isAttached(EdifNet net, EdifCellInstance cell, EdifPort port, int portBit)
          FROM EDIFNET - MODIFIED TO WORK WITH MULTI-BIT EDIFPORTS This method will return true if the given EdifPort&Bit/EdifCellInstance combination are attached to the given EdifNet.
static boolean isAttached(EdifNet net, EdifCellInstance cell, EdifSingleBitPort port)
           
static void replaceCellInstance(EdifCell parentCell, EdifCellInstance oldCellInstance, EdifCellInstance newCellInstance)
           
static void replaceCellInstance(EdifCell parentCell, EdifCellInstanceGraph graph, EdifCellInstance oldCellInstance, EdifCellInstance newCellInstance)
           
static void swapEdifPortRef(EdifNet net, EdifCellInstance oldInst, EdifCellInstance newInst)
           
static void swapEdifPortRef(EdifPortRef connection, EdifCellInstance neweci)
          Delete the given EdifPortRef from the EdifNet and add a new EdifPortRef to the neweci.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug_level

private static int debug_level
Constructor Detail

EdifTools

public EdifTools()
Method Detail

replaceCellInstance

public static void replaceCellInstance(EdifCell parentCell,
                                       EdifCellInstance oldCellInstance,
                                       EdifCellInstance newCellInstance)

replaceCellInstance

public static void replaceCellInstance(EdifCell parentCell,
                                       EdifCellInstanceGraph graph,
                                       EdifCellInstance oldCellInstance,
                                       EdifCellInstance newCellInstance)

swapEdifPortRef

public static void swapEdifPortRef(EdifNet net,
                                   EdifCellInstance oldInst,
                                   EdifCellInstance newInst)

swapEdifPortRef

public static void swapEdifPortRef(EdifPortRef connection,
                                   EdifCellInstance neweci)
Delete the given EdifPortRef from the EdifNet and add a new EdifPortRef to the neweci. This method assumes that the neweci has a Port of the same name/type as the EdifPort represented by connection.


getOuterNet

public static EdifNet getOuterNet(EdifCell cell,
                                  EdifCellInstance eci,
                                  EdifPort port,
                                  int portBit)
This method will return the EdifNet that connects to the given EdifPort BIT of the given EdifCellInstance in the given EdifCell


getOuterNet

public static EdifNet getOuterNet(EdifCell cell,
                                  EdifCellInstance eci,
                                  EdifPort port)

getPortRef

public static EdifPortRef getPortRef(EdifCell cell,
                                     EdifPort port)
FROM EDIFCELLINSTANCE - MODIFIED TO WORK ON AN EDIFCELL INSTEAD Returns the port ref that refers to the passed-in EdifPort.

Parameters:
port - The EdifPort Object that will be searched for within this EdifCellInstance
Returns:
The corresponding EdifPortRef

getInstancePortNet

public static EdifNet getInstancePortNet(EdifCell cell,
                                         EdifCellInstance instance,
                                         EdifPort port,
                                         int bit)
FROM EDIFCELL - MODIFIED TO WORK WITH MULTI-BIT EDIFPORTS This method will return the EdifNet that is connected to the given port on the given instance.

Parameters:
instance - The EdifCellInstance Object that one of the returned EdifNet Object's EdifPortRef Objects connects to
port - The EdifPort Object that one of the returned EdifNet Object's EdifPortRef Objects refers to
bit - The bit of the EdifPort that you want the EdifNet connected to
Returns:
An EdifNet Object that has an EdifPortRef Object that refers to the passed-in EdifPort Object, and connects to the passed-in EdifCellInstance Object

getInstancePortNet

public static EdifNet getInstancePortNet(EdifCell cell,
                                         EdifCellInstance instance,
                                         EdifSingleBitPort port)

isAttached

public static boolean isAttached(EdifNet net,
                                 EdifCellInstance cell,
                                 EdifPort port,
                                 int portBit)
FROM EDIFNET - MODIFIED TO WORK WITH MULTI-BIT EDIFPORTS This method will return true if the given EdifPort&Bit/EdifCellInstance combination are attached to the given EdifNet.

Parameters:
cell - An EdifCellInstance Object to check if one of the EdifPortRefs in this EdifNet Object connect to a port of that instance
port - An EdifPort Object to check if one of the EdifPortRefs in this EdifNet Object refer to that port
Returns:
True if this EdifNet is attached to the passed-in EdifPort/EdifCellInstance combination

isAttached

public static boolean isAttached(EdifNet net,
                                 EdifCellInstance cell,
                                 EdifSingleBitPort port)

isAttached

public static boolean isAttached(EdifNet net,
                                 EdifCellInstance cell)
FROM EDIFNET - MODIFIED TO COMPARE CELL INSTANCE NAMES INSTEAD OF CELL INSTANCE OBJECTS


getAttachedNets

public static java.util.Collection getAttachedNets(EdifCell cell,
                                                   EdifCellInstance inst)
This method will iterate through all of the nets in cell and return those nets that are connected to inst. This could be added to EdifCell.


cleanUpCell

public static void cleanUpCell(EdifCell cell)
Removes all dangling Nets and unconnected CellInstances from the passed EdifCell.