|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbyucc.edif.NamedPropertyObject
byucc.edif.EdifPort
Represents an Edif port, which belongs to a specific
EdifCell. This class specifies a port direction
(IN, OUT or
INOUT), and a width for support of
multi-bit ports.
Note that this object is immutable. Once this object has been created, it cannot be changed.
The purpose of an EdifPort object is to connect a net from the outer level of hierarchy to the inner level of heirarchy.
Sample EDIF code for an EdifPort:
(cell RAMB4_S2 (cellType GENERIC)
(view PRIM (viewType NETLIST)
(interface
(port (array (rename do "DO[1:0]") 2) (direction OUTPUT))
(port (array (rename addr "ADDR[10:0]") 11) (direction INPUT))
(port (array (rename di "DI[1:0]") 2) (direction INPUT))
(port EN (direction INPUT))
(port CLK (direction INPUT))
(port WE (direction INPUT))
(port RST (direction INPUT))
)
)
)
To Do:
| Field Summary | |
(package private) EdifNet[] |
_cachedInnerNets
Inner net: An inner net is the EdifNet array *within* the EdifCell object that are connected to this particular port. |
private int |
_direction
The direction of this EdifPort |
private EdifCellInterface |
_parentInterface
The EdifCellInterface to which the EdifPort belongs |
static int |
IN
Constant value representing that the EdifPort direction is IN. |
static int |
INOUT
Constant value representing that the EdifPort direction is INOUT. |
static int |
OUT
Constant value representing that the EdifPort direction is OUT. |
private EdifSingleBitPort[] |
singleBitPorts
|
| Fields inherited from class byucc.edif.NamedPropertyObject |
|
| Constructor Summary | |
EdifPort(EdifCellInterface parent,
EdifNameable name,
int width,
int direction)
Constructs an EdifPort according to the passed in name, width and direction. |
|
EdifPort(EdifCellInterface parent,
java.lang.String name,
int width,
int direction)
Constructs an EdifPort according to the passed in name, width and direction. |
|
| Method Summary | |
boolean |
busMatch(java.util.Collection ports)
|
boolean |
busMatch(java.util.Collection ports,
boolean ignoreBusDirection)
This method allows busses to match. |
boolean |
busMatch(EdifPort port)
|
boolean |
busMatch(EdifPort port,
boolean ignoreBusDirection)
This method allows busses to match. |
static boolean |
busMatch(EdifPort bus,
java.util.Collection ports)
Overloaded method defaulting to ignoring direction of the individual ports. |
private static boolean |
busMatch(EdifPort bus,
java.util.Collection ports,
boolean ignoreBusDirection)
This method allows busses to match. |
boolean |
busMatchWithin(java.util.Collection ports)
|
boolean |
busMatchWithin(java.util.Collection ports,
boolean ignoreBusDirection)
Returns true if this EdifPort Object contains a bus match with one of the EdifPort Objects in the passed-in Collection. |
void |
createCachedInnerNets()
This method will create the array of EdifNet objects. |
boolean |
equals(EdifPort port)
This method determines whether the EdifPort object passed in is the same as this EdifPort object. |
private static boolean |
equals(EdifPort port1,
EdifPort port2)
This method determines whether the EdifPort object passed in is the same as the other passed-in EdifPort object. |
private static boolean |
equals(EdifPort port1,
EdifPort port2,
boolean ignoreDirection)
This method determines whether the EdifPort object passed in is the same as the other passed-in EdifPort object. |
java.lang.String |
getBaseName()
|
int |
getBitPosition()
|
EdifCellInterface |
getCellInterface()
Returns the EdifCell which this EdifPort belongs to |
int |
getDirection()
Returns the EdifPort's direction There are three kinds of directions in this package: IN
OUT
INOUT |
java.lang.String |
getDirectionString()
|
EdifCell |
getEdifCell()
Returns the EdifCell that contains this port. |
EdifNet |
getInnerNet()
This method will return the EdifNet which connects this one bit wide EdifPort. |
EdifNet |
getInnerNet(int member)
This method will return the EdifNet which connects the designated bus member of this EdifPort. |
EdifNet[] |
getInnerNets()
This method will return an array of EdifNets, each EdifNet connects the corresponding bus member of this EdifPort( array index = bus member) inside the EdifCell which this EdifPort belongs to. |
int |
getLSB()
|
int |
getMSB()
|
static EdifPort |
getPortAtPosition(int bitPosition,
java.util.Collection ports)
Returns the EdifPort Object from the passed-in Collection of ports that match the passed-in bitPosition. |
EdifSingleBitPort |
getSingleBitPort(int i)
|
int |
getWidth()
Returns the EdifPort's width |
private void |
init(EdifCellInterface parent,
int width,
int direction)
Helper function for the constructor. |
void |
invalidateCachedInnerNets()
Invalidates cached inner nets. |
boolean |
isBus()
Returns true if this port is a bus-port, false otherwise. |
boolean |
isInOut()
Check if this port's direction is bidirectional |
boolean |
isInput()
Check if this port's direction is input, meaning IN or INOUT |
boolean |
isInputOnly()
Check if this port's direction is input only, meaning IN but not INOUT |
boolean |
isOutput()
Check if this port's direction is output, meaning OUT or INOUT |
boolean |
isOutputOnly()
Check if this port's direction is output only, meaning OUT but not INOUT |
boolean |
isPartOfBus()
|
static void |
makeDirectionsMatch(java.util.Collection dontChange,
java.util.Collection change)
Makes the directions of the second collection match the directions in the second collection. |
boolean |
matchesWithin(java.util.Collection portRefs)
Returns true if this EdifPort Object equals one of the passed-in collection of EdifPortRef Object's EdifPort. |
static int |
oppositeDirection(int dir)
Return the opposite direction |
void |
toEdif(EdifPrintWriter epw)
Writes the EDIF representation of this EdifPort object to the EdifPrintWriter passed as a parameter. |
java.lang.String |
toString()
Returns the string representation of the EdifPort |
| Methods inherited from class byucc.edif.NamedPropertyObject |
addProperty, addProperty, equals, equalsProperties, getEdifNameable, getName, getProperty, getPropertyList, rename, rename |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int IN
public static final int OUT
public static final int INOUT
private int _direction
private EdifSingleBitPort[] singleBitPorts
private EdifCellInterface _parentInterface
EdifNet[] _cachedInnerNets
An array of EdifNet references, one for each bus member of this EdifPort. Each referenced EdifNet connects to the corresponding EdifPort bus member inside the EdifCell which this EdifPort belongs to.
Note that this information is cached and is a duplication of information already contained in this data structure. The "owner" of this information is the parent EdifCell. The EdifCell contains this information in the list of EdifNets that connect ports within the Cell.
Because this data structure is a duplication, it can potentially be inconsistent with "true" data structure. To account for this, this data structure is "cached" and created only when needed. Whenever the circuit changes, this cached data is invalidated.
TODO: When should this data structure be invalidated?
Who can change EdifPort?
// * @see EdifCellInstance#_cachedOuterNets
| Constructor Detail |
public EdifPort(EdifCellInterface parent,
java.lang.String name,
int width,
int direction)
parent - The parent of this new EdifPortname - The name of this Objectwidth - The width of this EdifPortdirection - The direction of this EdifPort
public EdifPort(EdifCellInterface parent,
EdifNameable name,
int width,
int direction)
parent - The parent of this new EdifPortname - The Object holding name information for this
EdifPort Objectwidth - The width of this EdifPortdirection - The direction of this EdifPort| Method Detail |
private void init(EdifCellInterface parent,
int width,
int direction)
parent - The parent of this new EdifPortwidth - The width of this EdifPortdirection - The direction of this EdifPortpublic EdifSingleBitPort getSingleBitPort(int i)
public boolean busMatchWithin(java.util.Collection ports,
boolean ignoreBusDirection)
ports - The Collection of ports to find a bus match with
public boolean busMatchWithin(java.util.Collection ports)
public boolean busMatch(EdifPort port,
boolean ignoreBusDirection)
port - The EdifPort Object to find a bus match with this oneignoreBusDirection - If true, the direction of the individual
ports will be ignored
busMatch(EdifPort,Collection,boolean)public boolean busMatch(EdifPort port)
public boolean busMatch(java.util.Collection ports,
boolean ignoreBusDirection)
ports - A Collection of EdifPort Objects to compare for a
bus-match with this EdifPort ObjectignoreBusDirection - If true, the direction of the individual
ports will be ignored
busMatch(EdifPort,Collection,boolean)public boolean busMatch(java.util.Collection ports)
private static boolean busMatch(EdifPort bus,
java.util.Collection ports,
boolean ignoreBusDirection)
bus - The EdifPort Object to find a bus match with the
collection of passed-in EdifPort Objectsports - A Collection of EdifPort Objects to compare for a
bus-match with the passed in bus parameterignoreBusDirection - If true, the matching algorithm will
ignore the direction of the passed-in ports
busMatch(EdifPort),
busMatch(Collection)
public static boolean busMatch(EdifPort bus,
java.util.Collection ports)
bus - The EdifPort Object to find a bus match with the
collection of passed-in EdifPort Objectsports - A Collection of EdifPort Objects to compare for a
bus-match with the passed in bus parameter
busMatch(EdifPort,Collection,boolean)public void createCachedInnerNets()
public boolean equals(EdifPort port)
port - The EdifPort object to compare for equality with
this EdifPort Object
equals(EdifPort,EdifPort)
private static boolean equals(EdifPort port1,
EdifPort port2,
boolean ignoreDirection)
This method determines whether the two EdifPort objects are the same. The following criteria are used to make this comparison:
port1 - The first port used for comparisonport2 - The second port used for comparisonignoreDirection - Specifies whether the port directions
during a compare will be ignored or not
equals(EdifPort)
private static boolean equals(EdifPort port1,
EdifPort port2)
This method determines whether the two EdifPort objects are the same. The following criteria are used to make this comparison:
port1 - The first port used for comparisonport2 - The second port used for comparison
equals(EdifPort,EdifPort,boolean),
equals(EdifPort)public EdifCellInterface getCellInterface()
EdifCell value representing the
EdifCellInterface of this EdifPort Objectpublic EdifCell getEdifCell()
public EdifNet[] getInnerNets()
EdifNet objects representing
all the EdifNets that connect to this EdifPort Objectpublic EdifNet getInnerNet(int member)
member - an int representing the index of the
EdifNet of this bus
EdifNet representing the EdifNet at the
specified indexpublic EdifNet getInnerNet()
EdifNet value representing the EdifNet
Object that this EdifPort is connected to on the insidepublic int getLSB()
EdifBusNameOps.getLSB(byucc.edif.EdifNameable)public int getMSB()
EdifBusNameOps.getMSB(byucc.edif.EdifNameable)public int getDirection()
IN
OUT
INOUT
public java.lang.String getDirectionString()
public int getWidth()
int representing the width of this
EdifPortpublic java.lang.String getBaseName()
EdifBusNameOps.getBaseName(java.lang.String)public int getBitPosition()
EdifBusNameOps.getBitPosition(java.lang.String)
public static EdifPort getPortAtPosition(int bitPosition,
java.util.Collection ports)
bitPosition - The bit position is used to find the
EdifPort Object to returnports - The Collection of EdifPort Objects to find one
that matches the passed-in bit position
public void invalidateCachedInnerNets()
public boolean isPartOfBus()
EdifBusNameOps.isPartOfBus(java.lang.String)public boolean isBus()
public boolean isInOut()
public boolean isInput()
public boolean isInputOnly()
public boolean isOutput()
public boolean isOutputOnly()
public boolean matchesWithin(java.util.Collection portRefs)
portRefs - A Collection of EdifPortRef Objects that this
EdifPort Object will be compared to in order to determine if
a match exists between this EdifPort Object, and an
EdifPortRef Object within the Collection
public static void makeDirectionsMatch(java.util.Collection dontChange,
java.util.Collection change)
dontChange - The Collection whose directions will be
standardchange - The Collection whose directions will conform to
the firstpublic static int oppositeDirection(int dir)
dir - an int value representing the direction
of the EdifPort Object
int value representing the opposite
direction of the passed-in dir parameterpublic void toEdif(EdifPrintWriter epw)
EdifPrintWriter passed as a parameter.
toEdif in interface EdifOutepw - an EdifPrintWriter Object where the
EDIF data will be written topublic java.lang.String toString()
String value representing this Object,
its direction and inner nets
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||