|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.byu.ece.edif.core.NamedPropertyObject
edu.byu.ece.edif.core.EdifPort
public class 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 hierarchy.
Because ports in EDIF can represent both single and multiple bits, this class represents the port as a collection of EdifSingleBitPort objects. A distinct object is created for each bit of the port.
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)) ) ) )
| Field Summary | |
|---|---|
private int |
_direction
The direction of this EdifPort |
private EdifCellInterface |
_parentInterface
The EdifCellInterface to which the EdifPort belongs |
private EdifSingleBitPort[] |
_singleBitPorts
The array of single bit ports that make up this port object. |
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. |
| Constructor Summary | |
|---|---|
EdifPort(EdifCellInterface parent,
EdifNameable name,
int width,
int direction)
Construct an EdifPort according to the passed in name, width and direction. |
|
EdifPort(EdifCellInterface parent,
java.lang.String name,
int width,
int direction)
Construct an EdifPort according to the passed in name, width and direction. |
|
| Method Summary | |
|---|---|
private void |
_init(EdifCellInterface parent,
int width,
int direction)
Helper function for the constructor. |
(package private) int |
compareTo(EdifPort port)
This method is needed to use a TreeSet of EdifPort 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. |
EdifCellInterface |
getCellInterface()
Return the EdifCell which this EdifPort belongs to. |
int |
getDirection()
Return the EdifPort's direction There are three kinds of directions in this package: IN OUT
INOUT |
java.lang.String |
getDirectionString()
|
EdifCell |
getEdifCell()
Return the EdifCell that contains this port. |
EdifSingleBitPort |
getSingleBitPort(int i)
Returns the EdifSingleBitPort object associated with bit i of this port. |
java.util.List<EdifSingleBitPort> |
getSingleBitPortList()
|
int |
getWidth()
Return the width of this EdifPort. |
boolean |
isBus()
Return 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 |
isInput(boolean tristate)
Determine whether this port is an input. |
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 |
isOutput(boolean tristate)
Determine whether this port is an output. |
boolean |
isOutputOnly()
Check if this port's direction is output only, meaning OUT but not INOUT |
void |
toEdif(EdifPrintWriter epw)
Write the EDIF representation of this EdifPort object to the EdifPrintWriter passed as a parameter. |
java.lang.String |
toString()
Return the string representation of the EdifPort |
| Methods inherited from class edu.byu.ece.edif.core.NamedPropertyObject |
|---|
addProperty, addProperty, addPropertyList, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, 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 EdifCellInterface _parentInterface
private EdifSingleBitPort[] _singleBitPorts
| Constructor Detail |
|---|
public EdifPort(EdifCellInterface parent,
java.lang.String name,
int width,
int direction)
throws InvalidEdifNameException
parent - The parent of this new EdifPortname - The name of this Objectwidth - The width of this EdifPortdirection - The direction of this EdifPort
InvalidEdifNameException
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 |
|---|
public boolean equals(EdifPort port)
port - The EdifPort object to compare for equality with this
EdifPort Object
public EdifCellInterface getCellInterface()
EdifCell value representing the
EdifCellInterface of this EdifPort Objectpublic int getDirection()
IN OUT
INOUT
public java.lang.String getDirectionString()
public EdifCell getEdifCell()
public EdifSingleBitPort getSingleBitPort(int i)
i - Bit index of port.
public java.util.List<EdifSingleBitPort> getSingleBitPortList()
public int getWidth()
int representing the width of this EdifPortpublic boolean isBus()
public boolean isInOut()
public boolean isInput()
public boolean isInput(boolean tristate)
tristate - Indicates that a tri-state port (INOUT) should be
considered as an input. If false, this method will return false for ports
that are tri-state (INOUT).
public boolean isInputOnly()
public boolean isOutput()
public boolean isOutput(boolean tristate)
tristate - Indicates that a tri-state port (INOUT) should be
considered as an output. If false, this method will return false for
ports that are tri-state (INOUT).
public boolean isOutputOnly()
public 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()
toString in class java.lang.ObjectString value representing this Object, its
direction and inner nets
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)
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 EdifPortint compareTo(EdifPort port)
port -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||