byucc.jhdl.synth
Class DFVertex

java.lang.Object
  extended bybyucc.jhdl.synth.graph.NamedObject
      extended bybyucc.jhdl.synth.graph.Vertex
          extended bybyucc.jhdl.synth.DFVertex
All Implemented Interfaces:
Nameable

public class DFVertex
extends Vertex

The basic vertex for any DataFlowGraph. This class supports three different types of vertices: signals, constants, and operators. Signals represent named variables. Constants represent constant-valued objects. Operators represent an operation which accepts multiple inputs and generates a single ouput.

See Also:
DFEdge, DataFlowGraph

Field Summary
 
Fields inherited from class byucc.jhdl.synth.graph.Vertex
inEdgeVector, outEdgeVector, parent, visited
 
Fields inherited from class byucc.jhdl.synth.graph.NamedObject
name
 
Constructor Summary
DFVertex(Graph g, java.lang.String name)
          Construct a new DFVertex of the given name within the given graph.
DFVertex(Graph g, java.lang.String name, Wire wire)
          Construct a new DFVertex of the given name and associated with the given wire, within the given graph.
 
Method Summary
 java.lang.Object getAssociatedReference()
           
 Wire getAssociatedWire()
           
 int getBusWidth()
           
 int getConstantValue()
          Get an integer representation of a constant's value.
 java.lang.String getDFName()
          Get the appropriate name for this vertex.
 DFEdge getInputPort(java.lang.String portName)
          Get the Edge from this vertex that is connected to the named input port.
 java.lang.String getOperation()
          Get the operation name for this operator.
 DFEdge getOutputPort(java.lang.String portName)
          Get the Edge from this vertex that is connected to the named output port.
 DFSubGraph getParentalSubGraph()
          Get the parentalSubGraph to which this DFVertex belongs.
 java.lang.String getProperty(java.lang.String key)
          Returns the value associated with the given key.
 java.lang.String getSignalBasename()
          Get the base name for this signal.
 java.lang.String getSignalName()
          Get the signal name for this signal.
 boolean hasInputPort(java.lang.String portName)
          Does this signal have an input edge with the given headPort name.
 boolean hasOutputPort(java.lang.String portName)
          Does this signal have an output edge with the given tailPort name.
 boolean isAnnotation()
          Is the current vertex an annotation.
 boolean isConstant()
          Is the current vertex a constant.
 boolean isOperator()
          Is the current vertex an operator.
 boolean isRegistered()
          Is this wire registered? That is, should a register be created and attached to this wire when the graph is synthesized.
 void isRegistered(boolean flag)
          Set this wire to be registered or not.
 boolean isSignal()
          Is the current vertex a signale.
 void setAssociatedReference(java.lang.Object ref)
           
 void setAssociatedWire(Wire w)
           
 void setBusWidth(int width)
           
 void setConstantValue(int width, int value)
          Set the value for this constant.
 void setConstantWidthValue(int width, int value)
          Set the width and value for this constant.
 void setOperation(java.lang.String operation)
          Set the operation for this operator.
 void setProperty(java.lang.String key, java.lang.String value)
          Set a property, (a key->value pair), for this vertex.
 void setSignalName(java.lang.String name)
          Set the name for this signal.
 void setSignalWidthName(int width, java.lang.String name)
          Set the width and name for this signal.
 java.lang.String toString()
          Generate a String representation of this DFVertex.
 void uniquifySignal()
          Give this signal a unique name.
protected  java.lang.String vertexDotProperties()
           
 
Methods inherited from class byucc.jhdl.synth.graph.Vertex
findEdgeTo, getInEdges, getOutEdges, getParent, getSingleHead, getSingleTail, getVisited, inDegree, isAdjacent, isVisited, outDegree, resetVisit, toDot, vertexDotLabels, visit, visit
 
Methods inherited from class byucc.jhdl.synth.graph.NamedObject
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DFVertex

public DFVertex(Graph g,
                java.lang.String name)
Construct a new DFVertex of the given name within the given graph.

Parameters:
g - The graph (DataFlowGraph) in which this DFVertex should be created.
name - The name for the new DFVertex.

DFVertex

public DFVertex(Graph g,
                java.lang.String name,
                Wire wire)
Construct a new DFVertex of the given name and associated with the given wire, within the given graph.

Parameters:
g - The graph (DataFlowGraph) in which this DFVertex should be created.
name - The name for the new DFVertex.
wire - A wire to be associated with this vertex.
Method Detail

getParentalSubGraph

public DFSubGraph getParentalSubGraph()
Get the parentalSubGraph to which this DFVertex belongs.

Returns:
the subGraph to which this DFVertex belongs.

getDFName

public java.lang.String getDFName()
Get the appropriate name for this vertex. Since each vertex must have a unique name within the graph, the method getName in Vertex will return a rather ugly name that has uniquifying characters on it. This method returns a name that is not unique. For example, for signals and operators, this method will return the signal name or the operator name. (Although if you already know that you have a signal or an operator, it is preferred that you call getSignalName or getOperation rather than getDFName.)

Returns:
the text associated with the "label" property, if it exists, (that is, the name that actually appears on the graph in dotty). If no label is associated with the graph, this method simply returns the actual vertex name just like getName in Vertex.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Set a property, (a key->value pair), for this vertex. This method is called by the graph parser when reading in a .dot file. DFVertex supports arbitrary key->value pairs via a hashtable. The key "type" is handled specially in that its value can only be "singal", "constant", or "operator" and it will be stored as a single int.

Overrides:
setProperty in class Vertex
Parameters:
key - A string representing the key for this property.
value - A string representing the value associated with key.

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns the value associated with the given key. (Associations are formed through calls to setProperty).

Parameters:
key - The key of the property of interest.
Returns:
The value currently associated with the given key.
See Also:
setProperty(java.lang.String, java.lang.String)

isConstant

public boolean isConstant()
Is the current vertex a constant.

Returns:
true if the current vertex is a constant, false otherwise.

isSignal

public boolean isSignal()
Is the current vertex a signale.

Returns:
true if the current vertex is a signal, false otherwise.

isOperator

public boolean isOperator()
Is the current vertex an operator.

Returns:
true if the current vertex is an operator, false otherwise.

isAnnotation

public boolean isAnnotation()
Is the current vertex an annotation.

Returns:
true if the current vertex is an annotation, false otherwise.

getConstantValue

public int getConstantValue()
Get an integer representation of a constant's value.

Returns:
the integer representation of this constant's value. If this vertex is not a constant, the return value is undefined.

getSignalName

public java.lang.String getSignalName()
Get the signal name for this signal.

Returns:
the signal name of this signal. If this vertex is not a signal, the return value is undefined.

getSignalBasename

public java.lang.String getSignalBasename()
Get the base name for this signal.

Returns:
the signal name of this signal with any suffixes removed. Suffixes include both DataFlowGraph.WIRE_INPUT_SUFFIX and DataFlowGraph.WIRE_OUTPUT_SUFFIX

getOperation

public java.lang.String getOperation()
Get the operation name for this operator.

Returns:
the operation name of this operator. If this vertex is not an operator, the return value is undefined.

setConstantValue

public void setConstantValue(int width,
                             int value)
Set the value for this constant. If this vertex is a constant, set its value to value. (The result of this method is undefined if this vertex is not a constant.)

Parameters:
value - the new value for this constant.

setConstantWidthValue

public void setConstantWidthValue(int width,
                                  int value)
Set the width and value for this constant. If this vertex is a constant, set its width to width and its value to value. (The result of this method is undefined if this vertex is not a constant.)

Parameters:
width - the new width for this constant.
value - the new value for this constant.

uniquifySignal

public void uniquifySignal()
Give this signal a unique name.


setSignalName

public void setSignalName(java.lang.String name)
Set the name for this signal. If this vertex is a signal, set its name to name. (The result of this method is undefined if this vertex is not a signal.)

Parameters:
name - the new name for this signal.

setSignalWidthName

public void setSignalWidthName(int width,
                               java.lang.String name)
Set the width and name for this signal. If this vertex is a signal, set its width to width and its name to name. (The result of this method is undefined if this vertex is not a signal.)

Parameters:
width - the new width for this signal.
name - the new name for this signal.

setOperation

public void setOperation(java.lang.String operation)
Set the operation for this operator. If this vertex is an operator, set its operation to operation. (The result of this method is undefined if this vertex is not an operator)

Parameters:
operation - the new operation for this operator.

getAssociatedWire

public Wire getAssociatedWire()

getAssociatedReference

public java.lang.Object getAssociatedReference()

setAssociatedWire

public void setAssociatedWire(Wire w)

setAssociatedReference

public void setAssociatedReference(java.lang.Object ref)

getBusWidth

public int getBusWidth()

setBusWidth

public void setBusWidth(int width)

isRegistered

public boolean isRegistered()
Is this wire registered? That is, should a register be created and attached to this wire when the graph is synthesized.

Returns:
true if this wire should be registered, false otherwise.

isRegistered

public void isRegistered(boolean flag)
Set this wire to be registered or not.

Parameters:
flag - A boolean specifying whether this signal should be registered. That is, if the flag is true then a register will be inserted at this signal when the circuit is synthesized. If the flag is false then no register will be created.

hasInputPort

public boolean hasInputPort(java.lang.String portName)
Does this signal have an input edge with the given headPort name.

Parameters:
portName - The port name to look for on the input edges.

getInputPort

public DFEdge getInputPort(java.lang.String portName)
Get the Edge from this vertex that is connected to the named input port.

Parameters:
portName - The port name of the edge of interest.

hasOutputPort

public boolean hasOutputPort(java.lang.String portName)
Does this signal have an output edge with the given tailPort name.

Parameters:
portName - The port name to look for on the output edges.

getOutputPort

public DFEdge getOutputPort(java.lang.String portName)
Get the Edge from this vertex that is connected to the named output port.

Parameters:
portName - The port name of the edge of interest.

vertexDotProperties

protected java.lang.String vertexDotProperties()
Overrides:
vertexDotProperties in class Vertex

toString

public java.lang.String toString()
Generate a String representation of this DFVertex. I'll just use the name. See toDot for complete information.

Overrides:
toString in class Vertex
Returns:
a String representing this vertex.
See Also:
toDot


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