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

java.lang.Object
  extended by edu.byu.ece.edif.tools.replicate.nmr.BadCutConnections
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
XilinxBadCutConnections

public class BadCutConnections
extends java.lang.Object
implements java.io.Serializable

This class keeps track of "Bad Cut" connections. The user registers bad cut connections with the add methods and later may look up a connection pair and compare it against the register bad cut connections.

A connection is a pair of EdifPortRefs which are connected by a Net. Some connections may not be cut due to architecture restrictions.

Connections are represented internally by Strings which provide for fast lookup in the internal HashMap and HashSet Collections since equivalent strings have the same hashCode.

Author:
Brian Pratt
See Also:
Serialized Form

Field Summary
protected  java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> _badConnectionMap
          A Map that describes a set of bad cut connections.
static java.lang.String WILDCARD
           
 
Constructor Summary
BadCutConnections()
           
 
Method Summary
protected  java.lang.String _getEPRName(java.lang.String cellType, java.lang.String portName)
          Internal function to keep the lookup values consistent for a given EdifCell, EdifPortRef pair
 void addBadCutConnection(EdifPortRef sourceEPR, EdifPortRef sinkEPR)
          Adds a Bad Cut Connection to this object.
 void addBadCutConnection(java.lang.String sourceCellType, java.lang.String sourcePortName, java.lang.String sinkCellType, java.lang.String sinkPortName)
          Adds a Bad Cut Connection to this object.
 boolean isBadCutConnection(EdifPortRef epr1, EdifPortRef epr2)
          Determines whether the given set of Strings describe a Bad Cut Connection as contained in this object.
 boolean isBadCutConnection(java.lang.String sourceCellType, java.lang.String sourcePortName, java.lang.String sinkCellType, java.lang.String sinkPortName)
          Determines whether the given set of Strings describe a Bad Cut Connection as contained in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_badConnectionMap

protected java.util.HashMap<java.lang.String,java.util.Set<java.lang.String>> _badConnectionMap
A Map that describes a set of bad cut connections. Key: String representing the source EPR (CellType and PortName) Value: Set of Strings representing the sink EPRs for the Key that would cause a bad cut connection


WILDCARD

public static java.lang.String WILDCARD
Constructor Detail

BadCutConnections

public BadCutConnections()
Method Detail

addBadCutConnection

public void addBadCutConnection(java.lang.String sourceCellType,
                                java.lang.String sourcePortName,
                                java.lang.String sinkCellType,
                                java.lang.String sinkPortName)
Adds a Bad Cut Connection to this object.

Parameters:
sourceCellType - The String name of the source EdifCell
sourcePortName - The String name of the source EdifPort
sinkCellType - The String name of the sink EdifCell
sinkPortName - The String name of the sink EdifPort

addBadCutConnection

public void addBadCutConnection(EdifPortRef sourceEPR,
                                EdifPortRef sinkEPR)
Adds a Bad Cut Connection to this object.

Parameters:
sourceEPR - The source EdifPortRef of the connection
sinkEPR - The sink EdifPortRef of the connection

isBadCutConnection

public boolean isBadCutConnection(java.lang.String sourceCellType,
                                  java.lang.String sourcePortName,
                                  java.lang.String sinkCellType,
                                  java.lang.String sinkPortName)
Determines whether the given set of Strings describe a Bad Cut Connection as contained in this object.

Parameters:
sourceCellType - The String name of the source EdifCell
sourcePortName - The String name of the source EdifPort
sinkCellType - The String name of the sink EdifCell
sinkPortName - The String name of the sink EdifPort
Returns:
true if this connection is registered as a Bad Cut Connection

isBadCutConnection

public boolean isBadCutConnection(EdifPortRef epr1,
                                  EdifPortRef epr2)
Determines whether the given set of Strings describe a Bad Cut Connection as contained in this object.

The EdifPortRef objects may be passed in either source, sink or sink, source order. This method attempts to sort things out. If there are discrepancies (inout ports or non-connected ports), epr1 is assumed to be the source and epr2 is assumed to be the sink.

Parameters:
epr1 - The first EdifPortRef of the connection to check
epr2 - The second EdifPortRef of the connection to check
Returns:
true if this connection is registered as a Bad Cut Connection in this object.

_getEPRName

protected java.lang.String _getEPRName(java.lang.String cellType,
                                       java.lang.String portName)
Internal function to keep the lookup values consistent for a given EdifCell, EdifPortRef pair

Returns:
A standardized String to use in the internal Map