|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbyucc.jhdl.base.Nameable
byucc.jhdl.base.Node
byucc.jhdl.base.Cell
byucc.jhdl.base.Structural
byucc.jhdl.Logic.LogicGates
byucc.jhdl.Logic.LogicStatic
byucc.jhdl.Logic.Logic
byucc.jhdl.Logic.Modules.helpers.tb_Template
Generic superclass for Module testbenches. This is a helper class for creating testbenches which compare the structural and behavioral models of a Cell.
| Field Summary | |
protected static int |
ARG_MASK
|
protected java.lang.String[] |
b_outputNames
|
protected BV[] |
b_outputValues
|
protected static boolean |
continueOnFailure
|
protected static int |
FIXED
|
protected static int |
FIXED_BIAS
|
protected static int |
FIXED_MASK
|
protected static int |
FLOAT
|
protected java.lang.String[] |
inputNames
|
protected BV[][] |
inputValues
inputValues[steps_ago][input_index] are the input values that were put onto wires. |
protected static boolean |
interactive
|
protected static int |
iterations
|
protected java.lang.String[] |
outputNames
|
protected BV[] |
outputValues
|
protected java.util.Random |
random
A random number generator |
protected static int |
SIGNED
|
protected static int |
UNSIGNED
|
protected static boolean |
verbose
|
| Fields inherited from class byucc.jhdl.Logic.Logic |
ABOVE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_LSB, ALIGN_MSB, ALIGN_RIGHT, ALIGN_TOP, BELOW, DOWN, EAST_OF, LEFT_OF, MAX_PACK, NORTH_OF, ON, ONTOP, ONTOP_OF, RIGHT_OF, SOUTH_OF, TOLEFT, TORIGHT, UNCONSTRAINED, UP, WEST_OF |
| Fields inherited from class byucc.jhdl.Logic.LogicGates |
tech_mapper |
| Constructor Summary | |
tb_Template(Node parent)
Override this with a constructor that starts with "super (parent);" |
|
| Method Summary | |
protected void |
bindBehavior(Wire[] wa)
Tells the testbench template about the output wires from the behavioral model |
protected void |
bindInputs(Wire[] wa)
Tells the testbench template about the input wires. |
protected void |
bindInputTypes(int[] types)
Allows the user to specify input types, such as SIGNED, UNSIGNED, FLOAT, etc. |
protected void |
bindOutputs(Wire[] wa)
Tells the testbench template about the output wires from the structural model |
protected void |
bindOutputSigns(boolean[] signed)
Allows the user to specify which outputs are signed and which are unsigned, so that they appear correctly in the text output. |
protected void |
bindOutputTypes(int[] types)
Allows the user to specify output types, such as SIGNED, UNSIGNED, FLOAT, etc. |
protected void |
buildNetlist(Cell cell,
boolean xBuild)
Generates an EDIF netlist and optionally builds the design. |
void |
clock()
Puts values on the input wires when the circuit is clocked (called by getSystem().cycle(1) ) |
void |
execute()
The heart of the programmatic testbench. |
protected double |
fixedToDouble(BV bv,
int bitsRightOfRadixPoint)
|
protected BV |
getCorrespondingInput(Wire wire)
Returns the input on the wire from several cycles ago, so that the input value corresponds to the current output, even if the circuit is pipelined. |
protected int |
getLatency()
Override this to return the latency of the design. |
protected java.lang.String[][][] |
getTestVector()
(Optional) Override this to return the user-defined test vector. |
protected void |
getValues()
After a clock cycle, read the output wire values into variables |
void |
reset()
Puts values on the input wires when the circuit is reset (called by getSystem().reset() ) |
protected java.lang.String |
resultsToString()
Shows the input and output results as a String |
protected boolean |
runTestVector()
User-defined test vector |
protected boolean |
userTests()
Override this with a function to check for failure (Optional). |
| Methods inherited from class byucc.jhdl.base.Node |
addObservable, addSimulatorCallback, checkAll, delete, getBuildingFlag, getChildren, getChildrenEnumeration, getInstanceName, getParent, getParentCell, getRelatives, getSystem, getWires, optimize, orphanAllowed, printAllChildren, printTree, removeSimulatorCallback, setDefaultClock |
| Methods inherited from class byucc.jhdl.base.Nameable |
caseSensitivity, caseSensitivity, disableNameClashChecking, getFullName, getFullNameNoTestBench, getHierNameNoTestBench, getInstanceNo, getInstanceNumber, getLeafName, getLeafName, getRelativeName, getUserName, getUserName, hasUserSpecifiedName, isDescendantOf, setInstanceNumber |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static boolean continueOnFailure
protected static boolean verbose
protected static int iterations
protected static boolean interactive
protected java.util.Random random
protected BV[][] inputValues
protected BV[] outputValues
protected BV[] b_outputValues
protected java.lang.String[] inputNames
protected java.lang.String[] outputNames
protected java.lang.String[] b_outputNames
protected static final int UNSIGNED
protected static final int SIGNED
protected static final int FLOAT
protected static final int FIXED_BIAS
protected static final int FIXED_MASK
protected static final int FIXED
protected static final int ARG_MASK
| Constructor Detail |
public tb_Template(Node parent)
| Method Detail |
protected int getLatency()
protected BV getCorrespondingInput(Wire wire)
protected final void bindInputs(Wire[] wa)
protected final void bindOutputs(Wire[] wa)
protected final void bindBehavior(Wire[] wa)
protected final void bindOutputSigns(boolean[] signed)
protected final void bindInputTypes(int[] types)
protected final void bindOutputTypes(int[] types)
public void reset()
reset in interface Clockablereset in class Structuralpublic void clock()
clock in interface Clockableclock in class Structuralpublic void execute()
execute in interface ProgrammaticTestBenchprotected boolean userTests()
For instance, a floating-point module might test the simulation outputs against values computed by Java. It might only compare these values when the floating-point sizes match single- or double-precision.
protected java.lang.String[][][] getTestVector()
protected boolean runTestVector()
protected final void getValues()
protected java.lang.String resultsToString()
protected double fixedToDouble(BV bv,
int bitsRightOfRadixPoint)
protected void buildNetlist(Cell cell,
boolean xBuild)
cell - The cell to netlistxBuild - Set this to false (this is not a cross-platform option)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||