byucc.jhdl.util.xmac
Class WireInfo

java.lang.Object
  extended bybyucc.jhdl.util.xmac.WireInfo

public class WireInfo
extends java.lang.Object

This class essentially contains all the port and wire info for a xmac document. The methods give the user convenient access to all the info they should need about the wires.

Author:
Isaac E. Wagner

Field Summary
static int TYPE_GENERIC
          This is the type for generic ports.
static int TYPE_IMPLICIT
          This is the type for implicit ports.
static int TYPE_INVALID
          Invalid wire
static int TYPE_OPTIONAL
          This is the type for a port that is optional.
static int TYPE_PORT
          This is the type associated with just a standard port.
static int TYPE_WIRE
          This is the type for a wire, rather than a port.
 
Constructor Summary
WireInfo(org.w3c.dom.Node docRoot)
          Contructs a new WireInfo object.
 
Method Summary
 boolean firstWire()
          Sets the current wire to the first in the list.
 boolean genericPortExists()
          Test whether a generic port exists or not.
 boolean genericPortWidthExists()
          Test whether one or more of the port interface wires has a generic width.
 int getGenericCount()
          Returns the number of generic port entries in the current list.
 int getImplicitCount()
          Returns the number of implicit ports in the current list.
 int getOptionalCount()
          Returns the number of optional port entries in the current list.
 int getPortCount()
          Returns the number of ports not including generic and implicit ports.
 java.lang.String getPortType()
          Returns the type of the port such as: in, out, generic, etc.
 java.lang.String getPortValue()
          Get the value of the port.
 int getTotalWires()
          Returns the total combined number of wires and ports in the current list.
 int getWireCount()
          Returns the total number of wires.
 java.lang.String getWireName()
          Returns the name of the current wire.
 int getWireType()
          Returns the type of the wire as defined by the final static int members of this class.
 java.lang.String getWireWidth()
          Returns the width string of the current wire.
 java.lang.String getWireWidth(java.lang.String name)
          Get the width of a wire.
 boolean implicitPortExists()
          Test whether an implicit port exists or not.
 boolean nextWire()
          Increments the pointer to the next wire in the list.
 boolean optionalPortExists()
          Test whether a generic port exists or not.
 boolean setWireNumber(int number)
          Sets the current wire number the user wants to access.
 boolean validateWire(java.lang.String name)
          Checks if a given wire is a valid wire in the current list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_INVALID

public static final int TYPE_INVALID
Invalid wire

See Also:
Constant Field Values

TYPE_PORT

public static final int TYPE_PORT
This is the type associated with just a standard port.

See Also:
Constant Field Values

TYPE_IMPLICIT

public static final int TYPE_IMPLICIT
This is the type for implicit ports.

See Also:
Constant Field Values

TYPE_OPTIONAL

public static final int TYPE_OPTIONAL
This is the type for a port that is optional.

See Also:
Constant Field Values

TYPE_GENERIC

public static final int TYPE_GENERIC
This is the type for generic ports.

See Also:
Constant Field Values

TYPE_WIRE

public static final int TYPE_WIRE
This is the type for a wire, rather than a port.

See Also:
Constant Field Values
Constructor Detail

WireInfo

public WireInfo(org.w3c.dom.Node docRoot)
         throws java.lang.Exception
Contructs a new WireInfo object.

Parameters:
docRoot - The Node of the document to extract the info from.
Method Detail

validateWire

public boolean validateWire(java.lang.String name)
Checks if a given wire is a valid wire in the current list.

Parameters:
name - A String containing the name of the wire to validate.
Returns:
Returns true if the wire is valid and false otherwise.

genericPortExists

public boolean genericPortExists()
Test whether a generic port exists or not.

Returns:
true if one of the wires in the cell is generic, false otherwise.

optionalPortExists

public boolean optionalPortExists()
Test whether a generic port exists or not.

Returns:
true if one of the wires in the cell is generic, false otherwise.

implicitPortExists

public boolean implicitPortExists()
Test whether an implicit port exists or not.

Returns:
true if one of the wires in the cell interface is implicit, false otherwise.

genericPortWidthExists

public boolean genericPortWidthExists()
Test whether one or more of the port interface wires has a generic width.

Returns:
true if there is a port with a generic width, false otherwise.

setWireNumber

public boolean setWireNumber(int number)
Sets the current wire number the user wants to access. Returns true on success and false on failure.

Parameters:
number - The int that represents the wire number to access.
Returns:
true if the wire number was set, false on failure.

nextWire

public boolean nextWire()
Increments the pointer to the next wire in the list. Returns true on success and false on failure, such as indexed past end.

Returns:
true if pointer was changed, false if there are no more wires.

firstWire

public boolean firstWire()
Sets the current wire to the first in the list.

Returns:
true on success.

getWireWidth

public java.lang.String getWireWidth()
Returns the width string of the current wire.

Returns:
A String representation of the current wire width.

getWireWidth

public java.lang.String getWireWidth(java.lang.String name)
Get the width of a wire.

Parameters:
name - A String with the name of the wire.
Returns:
If the wire exists the width is returned, null otherwise.

getWireType

public int getWireType()
Returns the type of the wire as defined by the final static int members of this class.

Returns:
One of the final static int fields from above.

getWireName

public java.lang.String getWireName()
Returns the name of the current wire.

Returns:
A String with the name of the current wire or port.

getPortType

public java.lang.String getPortType()
Returns the type of the port such as: in, out, generic, etc.

Returns:
The type of the port such as: in, out, generic, etc.

getPortValue

public java.lang.String getPortValue()
Get the value of the port. This may or may not be set. A port value only exists if the type is generic. This will return an empty string if it doesn't exist.


getTotalWires

public int getTotalWires()
Returns the total combined number of wires and ports in the current list.

Returns:
An int with the total number of wires and ports in this cell.

getWireCount

public int getWireCount()
Returns the total number of wires.

Returns:
The total number of wires, not including ports.

getPortCount

public int getPortCount()
Returns the number of ports not including generic and implicit ports.

Returns:
The number of ports, not including wires, generics, and implicits.

getImplicitCount

public int getImplicitCount()
Returns the number of implicit ports in the current list.

Returns:
The number of implicit ports in the cells interface.

getGenericCount

public int getGenericCount()
Returns the number of generic port entries in the current list.

Returns:
The number of generic ports in the cell interface.

getOptionalCount

public int getOptionalCount()
Returns the number of optional port entries in the current list.

Returns:
The number of optional ports in the cell interface.


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.