byucc.jhdl.Logic.Modules.helpers
Class BehavioralPipeline

java.lang.Object
  extended bybyucc.jhdl.Logic.Modules.helpers.BehavioralPipeline

public class BehavioralPipeline
extends java.lang.Object

A helper class for pipelining in behavioral models.

BehavioralPipeline behaviorally simulates a pipeline. This is essentially a fixed-length FIFO queue that outputs the data that was put in n cycles ago.

To see an example, run java byucc.jhdl.Logic.Modules.helpers.BehavioralPipeline

BehavioralPipeline supports the following data types:

Choose one of these types for each BehavioralPipeline. Do not mix types within a pipeline. Use either put() and get() or putLong() and getLong().

Version:
$Revision: 1.5 $
Author:
Aaron Stewart

Constructor Summary
BehavioralPipeline(int stages)
          Creates a new behavioral pipeline.
 
Method Summary
 void clock()
          Clocks the pipeline one cycle.
 java.lang.Number get()
          Reads the output value from the last stage of the pipeline.
 long getLong()
          Reads the output value from the last stage of the pipeline.
 boolean isOutputValid()
          Returns true if the pipeline has had enough time for a valid output to appear.
static void main(java.lang.String[] argv)
          For testing (try it).
 void put(java.lang.Number object)
          Puts a value on the input of the pipeline.
 void putLong(long value)
          Puts a value on the input of the pipeline.
 java.lang.String toString()
          Returns a String representing the contents of the pipeline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BehavioralPipeline

public BehavioralPipeline(int stages)
Creates a new behavioral pipeline.

Parameters:
stages - The number of stages in the pipeline. If this is set to zero, the input goes directly to the output.
Method Detail

clock

public void clock()
Clocks the pipeline one cycle. This causes the values to move through one stage of the pipeline.


put

public void put(java.lang.Number object)
Puts a value on the input of the pipeline. It will be registered when the clock() method is called.

*** USE IMMUTABLE OBJECTS ONLY! ***


get

public java.lang.Number get()
Reads the output value from the last stage of the pipeline.


putLong

public void putLong(long value)
Puts a value on the input of the pipeline. It will be registered when the clock() method is called.


getLong

public long getLong()
Reads the output value from the last stage of the pipeline.


isOutputValid

public boolean isOutputValid()
Returns true if the pipeline has had enough time for a valid output to appear.


toString

public java.lang.String toString()
Returns a String representing the contents of the pipeline.


main

public static void main(java.lang.String[] argv)
For testing (try it). This is also an example of how to use the BehavioralPipeline class.



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