byucc.jhdl.synth
Class DFEdge

java.lang.Object
  extended bybyucc.jhdl.synth.graph.Edge
      extended bybyucc.jhdl.synth.DFEdge

public class DFEdge
extends Edge

The basic edge for any DataFlowGraph. This edge contains support for named ports. That is, it can have two properties tailPort and headPort that are strings giving the name of the ports to which this edge is attached.

See Also:
DFVertex, DataFlowGraph

Field Summary
 
Fields inherited from class byucc.jhdl.synth.graph.Edge
head, tail
 
Constructor Summary
DFEdge(Vertex tail, java.lang.String tailPort, Vertex head)
          Construct a new DFEdge pointing from tail to head with the given tail port name.
DFEdge(Vertex tail, java.lang.String tailPort, Vertex head, java.lang.String headPort)
          Construct a new DFEdge pointing from tail to head with the given port names.
DFEdge(Vertex tail, Vertex head)
          Construct a new DFEdge pointing from tail to head.
DFEdge(Vertex tail, Vertex head, java.lang.String headPort)
          Construct a new DFEdge pointing from tail to head with the given head port name.
 
Method Summary
protected  java.lang.String edgeDotLabels()
           
protected  java.lang.String edgeDotProperties()
           
 java.lang.String getHeadPort()
          Get the port name from the head of this edge.
 java.lang.String getTailPort()
          Get the port name from the tail of this edge.
 boolean setBusWidth(int width)
          Set the bus width for this edge.
 void setHeadPort(java.lang.String name)
          Set the port name for the head of this edge.
 void setProperty(java.lang.String key, java.lang.String value)
          Set a property, (a key->value pair), for this edge.
 void setTailPort(java.lang.String name)
          Set the port name for the tail of this edge.
 
Methods inherited from class byucc.jhdl.synth.graph.Edge
equals, getHead, getTail, setHead, setTail, toDot, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DFEdge

public DFEdge(Vertex tail,
              Vertex head)
Construct a new DFEdge pointing from tail to head.

Parameters:
tail - The tail vertex for the new edge.
head - The head vertex for the new edge.

DFEdge

public DFEdge(Vertex tail,
              java.lang.String tailPort,
              Vertex head,
              java.lang.String headPort)
Construct a new DFEdge pointing from tail to head with the given port names.

Parameters:
tail - The tail vertex for the new edge.
tailPort - The port name for the tail vertex of the edge.
head - The head vertex for the new edge.
headPort - The port name for the head vertex of the edge.

DFEdge

public DFEdge(Vertex tail,
              java.lang.String tailPort,
              Vertex head)
Construct a new DFEdge pointing from tail to head with the given tail port name.

Parameters:
tail - The tail vertex for the new edge.
tailPort - The port name for tail vertex of the edge.
head - The head vertex for the new edge.

DFEdge

public DFEdge(Vertex tail,
              Vertex head,
              java.lang.String headPort)
Construct a new DFEdge pointing from tail to head with the given head port name.

Parameters:
tail - The tail vertex for the new edge.
head - The head vertex for the new edge.
headPort - The port name for the head vertex of the edge.
Method Detail

setBusWidth

public boolean setBusWidth(int width)
Set the bus width for this edge. Now, an edge doesn't really have a bus width per se. The notion of bus width is something that is associated with the DFVertex within the DataFlowGraph. However, it sometimes happens that we need to change the width of only a single edge. For example, imagine signal A has width 32 and has several different out edges. Let's also suppose that one of those out edges is the input to a 4-bit adder. Now, the input to the adder should be 4 bits rather than the 32 bits of A. What we want to do here is to change the width of just that one edge to 4 bits, without affecting any of the other 32-bit out edges of A. Of course, an edge cannot actually hold a width, so what we actually do in DFEdge.setBusWidth is split the edge and insert a new operator. The new operator is either a range or a zeroPad operator depending on whether the output width is larger or smaller than the input width, respectively. Note: This method may remove the original edge. This means that if you have an EdgeIterator that is currently pointing to this edge, you will likely want to back it up once with prev() before iterating to avoid skipping past the next edge in the list. (I really need to come up with a better solution for that problem.) Also note: even though I delete the original edge, I take care to preserve the portNames and apply them to the new edges.

Parameters:
width - The new width for the edge
Returns:
true if the old edge was removed, false otherwise.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Set a property, (a key->value pair), for this edge. This method is called by the graph parser when reading in a .dot file. DFEdge supports string properties tailPort and headPort. No other properties are supported.

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

setTailPort

public void setTailPort(java.lang.String name)
Set the port name for the tail of this edge.

Parameters:
name - the name for the port at the tail of this edge.

setHeadPort

public void setHeadPort(java.lang.String name)
Set the port name for the head of this edge.

Parameters:
name - the name for the port at the head of this edge.

getTailPort

public java.lang.String getTailPort()
Get the port name from the tail of this edge.

Returns:
the name of the port at which this edge is connected to tail.

getHeadPort

public java.lang.String getHeadPort()
Get the port name from the head of this edge.

Returns:
the name of the port at which this edge is connected to head.

edgeDotProperties

protected java.lang.String edgeDotProperties()
Overrides:
edgeDotProperties in class Edge

edgeDotLabels

protected java.lang.String edgeDotLabels()
Overrides:
edgeDotLabels in class Edge


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