byucc.edif
Class EdifPortRef

java.lang.Object
  extended bybyucc.edif.EdifPortRef
All Implemented Interfaces:
java.io.Serializable

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

Represents a port reference within an EdifEnvironment. This object contains a reference to an EdifPort, an EdifNet, and an EdifCellInstance. The EdifPort object is a port that is contained by an EdifCell object. The EdifNet object is the parent or "owner" of this object (i.e. this object is contained in the EdifNet list of EdifPortRef objects). The EdifCellInstance object refers to the cell instance that owns the port. If this reference is null, the referenced port is a top-level port found in the EdifCell that owns the EdifNet object.

To Do:

Version:
$Id: EdifPortRef.java,v 1.36 2004/08/27 19:16:42 tsa6 Exp $
Author:
Welson Sun, Mike Wirthlin, Tyler Anderson
See Also:
EdifPortRef, EdifNet, Serialized Form

Field Summary
private  EdifCellInstance _cellInstance
          The EdifCellInstance Object that this EdifPortRef Object connects to.
private  EdifNet _net
          The EdifNet Object that connects to this EdifPortRef Object.
private  EdifSingleBitPort _refSingleBitPort
          The EdifPort Object this EdifPortRef Object refers to.
 
Constructor Summary
EdifPortRef(EdifNet net, EdifPort port, EdifCellInstance instance)
          Deprecated. Please use EdifPortRef(EdifNet,EdifSingleBitPort,EdifCellInstance) instead
EdifPortRef(EdifNet net, EdifPort port, EdifCellInstance instance, int busMember)
          Deprecated. Please use EdifPortRef(EdifNet,EdifSingleBitPort,EdifCellInstance) instead
EdifPortRef(EdifNet net, EdifSingleBitPort port, EdifCellInstance instance)
          A constructor for the new EdifSingleBitPort.
 
Method Summary
 java.lang.Object clone()
          Copies reference of refPort (DOES NOT COPY PORT!)
 boolean equalsPortRefWithin(java.util.Collection portRefs)
          Returns true if the current port ref's port equals within one of the passed-in collection of EdifPortRef Object's port.
 boolean equalsPortWithin(java.util.Collection ports)
          Returns true if the current port ref equals within one of the passed-in collection of EdifPort Objects.
 int getBusMember()
          Returns the index this EdifPortRef Object refers to within a bus.
 EdifCellInstance getCellInstance()
          Returns the EdifCellInstance Object that this EdifPortRef Object connects to.
 EdifNet getNet()
          Returns the EdifNet Object that this EdifPortRef Object is connected to.
 EdifPort getPort()
          Returns the EdifPort Object that this EdifPortRef Object refers to.
 EdifCellInstance getRefCell()
          Deprecated. This method has been deprecated in favor of the EdifPort.getCellInstance() method that contains a more intuitive method name.
 EdifPort getRefPort()
          Deprecated. This method has been deprecated in favor of the EdifPort.getPort() method that contains a more intuitive method name.
 EdifSingleBitPort getSingleBitPort()
          Returns the EdifSingleBitPort Object that this EdifPortRef Object refers to.
private  void init(EdifNet net, EdifSingleBitPort port, EdifCellInstance i)
           
 boolean matchesWithin(java.util.Collection portRefs)
          Returns true if the current port ref matches within the passed-in collection of EdifPortRef Objects.
 boolean refersToSingleBitPort()
          Returns true if port ref corresponds to a single-bit port (i.e. bus member = -1).
 boolean refersToTopLevelPort()
           
 java.lang.String toString()
          Returns a String representation of this Object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_refSingleBitPort

private EdifSingleBitPort _refSingleBitPort
The EdifPort Object this EdifPortRef Object refers to.


_cellInstance

private EdifCellInstance _cellInstance
The EdifCellInstance Object that this EdifPortRef Object connects to.


_net

private EdifNet _net
The EdifNet Object that connects to this EdifPortRef Object.

Constructor Detail

EdifPortRef

public EdifPortRef(EdifNet net,
                   EdifPort port,
                   EdifCellInstance instance)
Deprecated. Please use EdifPortRef(EdifNet,EdifSingleBitPort,EdifCellInstance) instead

Constructs an atomic EdifPortRef object based on a given net, port, and instnace with a bus member = -1 (i.e. hooked up to a single-bit port).

Parameters:
net - The EdifNet Object this EdifPortRef Object is connected to
port - The EdifPort Object that this EdifPortRef refers to
instance - The EdifCellInstance Object this EdifPortRef connects to

EdifPortRef

public EdifPortRef(EdifNet net,
                   EdifPort port,
                   EdifCellInstance instance,
                   int busMember)
Deprecated. Please use EdifPortRef(EdifNet,EdifSingleBitPort,EdifCellInstance) instead

Constructs an atomic EdifPortRef object based on a given net, port, and instance with a bus member.

Parameters:
net - The EdifNet Object this EdifPortRef Object is connected to
port - The EdifPort Object that this EdifPortRef refers to
instance - The EdifCellInstance Object this EdifPortRef connects to
busMember - The position within the EdifPort object to retrieve the EdifSingleBitPort

EdifPortRef

public EdifPortRef(EdifNet net,
                   EdifSingleBitPort port,
                   EdifCellInstance instance)
A constructor for the new EdifSingleBitPort.

Parameters:
net - The EdifNet Object this EdifPortRef Object is connected to
port - The EdifSingleBitPort Object that this EdifPortRef refers to
instance - The EdifCellInstance Object this EdifPortRef connects to
Method Detail

init

private void init(EdifNet net,
                  EdifSingleBitPort port,
                  EdifCellInstance i)

clone

public java.lang.Object clone()
Copies reference of refPort (DOES NOT COPY PORT!) Copies referencs of EdifCellInstance (DOES NOT COPY INSTANCE) Copies reference to EdifNet (DOES NOT COPY NET)

Returns:
an Object that is a copy or clone of this EdifPortRef Object

equalsPortWithin

public boolean equalsPortWithin(java.util.Collection ports)
Returns true if the current port ref equals within one of the passed-in collection of EdifPort Objects. Equality done by ==.

Parameters:
ports - A Collection of EdifPort Objects that this EdifPortRef Object will be compared to in order to determine if an EdifPort exists between this EdifPortRef Object, and an EdifPort Object within the Collection
Returns:
True if a port exists between this EdifPortRef Object and an EdifPort Object within the passed-in Collection of EdifPort Objects

equalsPortRefWithin

public boolean equalsPortRefWithin(java.util.Collection portRefs)
Returns true if the current port ref's port equals within one of the passed-in collection of EdifPortRef Object's port. Equality done by ==.

Parameters:
portRefs - A Collection of EdifPortRef Objects that the port of this EdifPortRef Object will be compared to in order to determine if an EdifPort exists between this EdifPortRef Object, and an EdifPortRef Object within the Collection
Returns:
True if a port exists between this EdifPortRef Object and an EdifPortRef Object within the passed-in Collection of EdifPortRef Objects

getBusMember

public int getBusMember()
Returns the index this EdifPortRef Object refers to within a bus.

Returns:
An int specifying the index this EdifPortRef Object refers to within a bus

getNet

public EdifNet getNet()
Returns the EdifNet Object that this EdifPortRef Object is connected to.

Returns:
An EdifNet Object that this EdifPortRef Object is connected to

getRefCell

public EdifCellInstance getRefCell()
Deprecated. This method has been deprecated in favor of the EdifPort.getCellInstance() method that contains a more intuitive method name.


getCellInstance

public EdifCellInstance getCellInstance()
Returns the EdifCellInstance Object that this EdifPortRef Object connects to.

Returns:
An EdifCellInstance Object that this EdifPortRef Object connects to

getRefPort

public EdifPort getRefPort()
Deprecated. This method has been deprecated in favor of the EdifPort.getPort() method that contains a more intuitive method name.

Returns the EdifPort Object that this EdifPortRef Object refers to.

Returns:
The EdifPort Object referred to by this EdifPortRef Object

getPort

public EdifPort getPort()
Returns the EdifPort Object that this EdifPortRef Object refers to.

Returns:
The EdifPort Object referred to by this EdifPortRef Object

getSingleBitPort

public EdifSingleBitPort getSingleBitPort()
Returns the EdifSingleBitPort Object that this EdifPortRef Object refers to.

Returns:
The EdifSingleBitPort Object referred to by this EdifPortRef Object

matchesWithin

public boolean matchesWithin(java.util.Collection portRefs)
Returns true if the current port ref matches within the passed-in collection of EdifPortRef Objects. Equality done by doing a deep compare on the ports.

Parameters:
portRefs - A Collection of EdifPortRef Objects that this EdifPortRef Object will be compared to in order to determine if a match exists between this EdifPortRef Object, and an EdifPortRef Object within the Collection
Returns:
True if a match exists between this EdifPortRef Object and an EdifPortRef Object within the passed-in Collection of EdifPortRef Objects

refersToSingleBitPort

public boolean refersToSingleBitPort()
Returns true if port ref corresponds to a single-bit port (i.e. bus member = -1).


refersToTopLevelPort

public boolean refersToTopLevelPort()

toString

public java.lang.String toString()
Returns a String representation of this Object.

Returns:
A String representing this object