byucc.jhdl.platforms.util
Class PortAssociation

java.lang.Object
  extended bybyucc.jhdl.platforms.util.PortAssociation
All Implemented Interfaces:
UtilConstants

public class PortAssociation
extends java.lang.Object
implements UtilConstants

Class used to associate a port with a wire to be connected to it. This class is intended mainly for the use of telling the GenericBoard class how to hook up PEs, memories, fifos, etc. This is strictly a named association, the class will call GenericBoard.getWire() to get the wire by name. This method in GenericBoard will create a wire if none exists, or return the existing wire if it does exist.


Field Summary
 
Fields inherited from interface byucc.jhdl.platforms.util.UtilConstants
directions, IN, NONE, OUT, TRISTATE, UNASSIGNED
 
Constructor Summary
PortAssociation(GenericBoard board, java.lang.String instance, java.lang.String classname)
          Constructs a new PortAssociation object with the specified GenericBoard as its "parent".
 
Method Summary
 void addAssociation(java.lang.String port, Wire wire)
          Used to add a new association to the object.
 void bindBasedOn(java.lang.String param, java.lang.String port)
          Used to make bind calls.
 void connectAllPorts(Logic pe)
          Connects all ports to wires as contained in this PortAssociation obeject.
 java.lang.String getClassName()
          Get the class name for this PortAssociation.
 java.lang.String getInstanceName()
          Get the instance name for this PortAssociation.
 Wire getWire(java.lang.String portname)
          Gets wires returned from connect calls.
 Wire gw(java.lang.String portname)
          Gets wires returned from connect calls.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortAssociation

public PortAssociation(GenericBoard board,
                       java.lang.String instance,
                       java.lang.String classname)
Constructs a new PortAssociation object with the specified GenericBoard as its "parent".

Parameters:
board - GenericBoard which will be used to get the wires specified in the associations.
classname - Fully qualified classname for the class for which the connection information is to be generated.
instance - Instance name for the cell for which the connection information is to be generated.
Method Detail

addAssociation

public void addAssociation(java.lang.String port,
                           Wire wire)
Used to add a new association to the object.

Parameters:
port - Name of the port.
wire - Name of the wire.

connectAllPorts

public void connectAllPorts(Logic pe)
Connects all ports to wires as contained in this PortAssociation obeject.

Parameters:
pe - Pe for which the connects are to be made.

getWire

public Wire getWire(java.lang.String portname)
Gets wires returned from connect calls.

Returns:
Returns the wire returned from the connect() call. If connect calls are not yet done, or if the portname is invalid, null will be returned.

gw

public Wire gw(java.lang.String portname)
Gets wires returned from connect calls.

Returns:
Returns the wire returned from the connect() call. If connect calls are not yet done, or if the portname is invalid, null will be returned.

getClassName

public java.lang.String getClassName()
Get the class name for this PortAssociation.

Returns:
Class name for this PortAssociation.

getInstanceName

public java.lang.String getInstanceName()
Get the instance name for this PortAssociation.

Returns:
Instance name for this PortAssociation.

bindBasedOn

public void bindBasedOn(java.lang.String param,
                        java.lang.String port)
Used to make bind calls. Can only be used to bind a parameter based on a single wire's width. In other words, this is only used to bind parameters based on a single wire passed into a port. All other bind calls should be made by the user.

Parameters:
param - Parameter to bind.
port - Port used to get the width for the bind call.

toString

public java.lang.String toString()


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