byucc.jhdl.platforms.util.readback
Class ReadBackManager

java.lang.Object
  extended bybyucc.jhdl.platforms.util.readback.ReadBackManager
Direct Known Subclasses:
ReadWriteBackManager

public class ReadBackManager
extends java.lang.Object

This class provides a testbench (frequently, a board model) with the functionality required to manage readback for a board of contiguously numbered PEs starting with PE 0. This includes the functionality to initialize the readback data structures of specific PEs, enable or disable the readback of specific PEs, and provide the testbench with a way of retrieving readback data for an array of ExternallyUpdateable and LargeExternallyUpdateable Cells.

Author:
Paul Graham

Field Summary
protected  java.util.Hashtable euCellHash
          A Hashtable of all ExternallyUpdatable Cells known and available from the initialized ReadBackData objects.
protected  java.util.Hashtable leuCellHash
          A Hashtable of all LargeExternallyUpdatable Cells known and available from the initialized ReadBackData objects.
protected  int peCount
          Stores the number of PEs used in the testbench.
protected  boolean[] peRBEnabled
          An array of booleans used to record whether or not a PE is sampled, or readback, when a performReadBack() method call is made.
protected  ReadBackData[] readBackData
          The array of ReadBackData objects, one for each PE.
 
Constructor Summary
  ReadBackManager(NativeReadBackInterface newRBI, int newPeCount)
          The constructor allocates and initializes the data structures for managing readback for the testbench.
protected ReadBackManager(NativeReadBackInterface newRBI, int newPeCount, boolean dummy)
          This is only used by ReadWriteBackManager.
 
Method Summary
 void addReadBack(java.lang.String fileName, java.lang.String hierName, int peNum)
          Initializes the readback data structures for a specific PE.
 void disableReadBack(int peNum)
          Disables readback for a specific PE on subsequent calls to performReadBack().
 void enableReadBack(int peNum)
          Enables readback for a specific PE on subsequent calls to performReadBack().
 int[] getEUValues(ExternallyUpdateable[] eCells)
          Provides an array of readback values corresponding to the given array of ExternallyUpdatable Cells.
 int[][] getLEUValues(LargeExternallyUpdateable[] leCells)
          Provides an array of readback values corresponding to the given array of LargeExternallyUpdatable Cells.
 void performReadBack()
          Causes the state of all enabled PEs to be sampled.
 void removeReadBack(int peNum)
          Reinitializes the readback data structures to a "clean" state.
 void setReadBackEnable(int peNum, boolean enabled)
          Sets the readback enable for the given PE to the provided value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readBackData

protected ReadBackData[] readBackData
The array of ReadBackData objects, one for each PE.


euCellHash

protected java.util.Hashtable euCellHash
A Hashtable of all ExternallyUpdatable Cells known and available from the initialized ReadBackData objects. This is used to look up the readback values of ExternallyUpdateable objects. The key for the Hashtable is a Cell reference while the value is a LookUp object.


leuCellHash

protected java.util.Hashtable leuCellHash
A Hashtable of all LargeExternallyUpdatable Cells known and available from the initialized ReadBackData objects. This is used to look up the readback values of LargeExternallyUpdateable objects. The key for the Hashtable is a Cell reference while the value is a LookUp object.


peRBEnabled

protected boolean[] peRBEnabled
An array of booleans used to record whether or not a PE is sampled, or readback, when a performReadBack() method call is made.


peCount

protected int peCount
Stores the number of PEs used in the testbench.

Constructor Detail

ReadBackManager

public ReadBackManager(NativeReadBackInterface newRBI,
                       int newPeCount)
The constructor allocates and initializes the data structures for managing readback for the testbench. The PE count and a NativeReadBackInterface reference is recorded.

Parameters:
newRBI - A reference to the NativeReadBackInterface to be used by the ReadBackData objects.
newPeCount - The number of PEs for which this object will manage readback. Note that PE numbering is assumed to start at 0.

ReadBackManager

protected ReadBackManager(NativeReadBackInterface newRBI,
                          int newPeCount,
                          boolean dummy)
This is only used by ReadWriteBackManager.

Method Detail

addReadBack

public void addReadBack(java.lang.String fileName,
                        java.lang.String hierName,
                        int peNum)
Initializes the readback data structures for a specific PE. It is usually used by testbenches.

Parameters:
fileName - The base filename (i.e., without extension) for the PE's design.
hierName - The full hierarchical JHDL name for the PE (used for generating full hierarchical names for JHDL Cells).
peNum - The number of the PE to initialize.

setReadBackEnable

public void setReadBackEnable(int peNum,
                              boolean enabled)
Sets the readback enable for the given PE to the provided value. It is usually used by testbenches.

Parameters:
peNum - The number of the PE whose readback enable is being set.
enabled - The value of the PE enable. A true value causes the PE's state to be read back on subsequent calls to performReadBack(). A false value will prevent the state from being readback.

enableReadBack

public void enableReadBack(int peNum)
Enables readback for a specific PE on subsequent calls to performReadBack(). It is usually used by testbenches.

Parameters:
peNum - The number of the PE for which to enable readback.

disableReadBack

public void disableReadBack(int peNum)
Disables readback for a specific PE on subsequent calls to performReadBack(). It is usually used by testbenches.

Parameters:
peNum - The number of the PE for which to disable readback.

performReadBack

public void performReadBack()
Causes the state of all enabled PEs to be sampled. It is usually used by testbenches.


removeReadBack

public void removeReadBack(int peNum)
Reinitializes the readback data structures to a "clean" state. This would be useful if the board's state is reinitialized or if a PE has been reconfigured. This would normally be used by a testbench.

Parameters:
peNum - The number of the PE for which the readback structures should be reinitialized.

getEUValues

public int[] getEUValues(ExternallyUpdateable[] eCells)
Provides an array of readback values corresponding to the given array of ExternallyUpdatable Cells. If a Cell cannot be found in the Hashtable, the value for the Cell is set to 0; this would happen if the Cell has been optimized away or if there are version inconsistencies between the class file and the executed design. If a null list of ExternallyUpdatable Cells is passed in, a null int array reference is returned. This would usually be used by the testbench in its implementation of the HardwareInterface.getHardwareState(ExternallyUpdateable[],LargeExternallyUpdateable[],Checkpointable[]).

Parameters:
eCells - An array of ExternallyUpdatable Cells for which the last known readback values are needed. This is generally provided by the ExternalUpdateManager.
Returns:
If the eCells reference is null, then returned int array reference will also be null. Otherwise, the array provides the last known readback value for the ExternallyUpdateable Cells in the array. For those Cells for which no value is found, a zero (0) value is returned.

getLEUValues

public int[][] getLEUValues(LargeExternallyUpdateable[] leCells)
Provides an array of readback values corresponding to the given array of LargeExternallyUpdatable Cells. If a Cell cannot be found in the Hashtable, the values for the Cell are set to 0; this would happen if the Cell has been optimized away or if there are version inconsistencies between the class file and the executed design. If a null list of LargeExternallyUpdatable Cells is passed in, a null int array reference is returned. This would usually be used by the testbench in its implementation of the HardwareInterface.getHardwareState(ExternallyUpdateable[],LargeExternallyUpdateable[],Checkpointable[]).

Parameters:
leCells - An array of LargeExternallyUpdatable Cells for which the last known readback values are needed. This is generally provided by the ExternalUpdateManager.
Returns:
If the leCells reference is null, then returned int array reference will also be null. Otherwise, the array provides the last known readback value for the LargeExternallyUpdateable Cells in the array. For those Cells for which no value is found, a null array is returned.


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