|
|||||||||||
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.LibrarySelfTester
This class aids in testing components of a library. By extending this class, a library can efficiently run built-in test vectors.
Field Summary |
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 | |
LibrarySelfTester()
Creates a new LibrarySelfTester. |
|
LibrarySelfTester(int verbosity)
Creates a new LibrarySelfTester, with specified verbosity. |
Method Summary | |
void |
clock()
Performs the clock-by-clock test behavior of the library test. |
void |
fullTest(java.lang.String[] argv)
Uses reflection to run the static test() method of various cells in the library. |
protected abstract java.lang.String |
getLibraryPackageName()
Determines the package of the library, no ending period. |
protected abstract TechMapper |
getLibraryTechMapper()
Returns the correct type of techmapper. |
java.lang.String |
getSyntax()
This gives the acceptable command-line syntax for this version of self-tester. |
protected abstract java.lang.String[] |
getTestlist()
This returns a list of classes to test. |
static void |
main(java.lang.String[] argv)
Runs the full library test. |
void |
reset()
Performs the reset cycle test behavior of the library test. |
void |
setCell(Cell c)
Initializes the test vectors for the given cell. |
static void |
setTechMapping(boolean flag)
Sets techmapping enabling during tests (default on). |
void |
setVector(java.lang.String name,
int[][] arr,
Wire wire)
Sets the contents of the test vector for the port identified by the String parameter. |
void |
setVector(java.lang.String name,
int[] arr,
Wire wire)
Sets the contents of the test vector for the port identified by the String parameter. |
void |
setVector(java.lang.String name,
long[] arr,
Wire wire)
Sets the contents of the test vector for the port identified by the String parameter. |
void |
setVector(java.lang.String name,
java.lang.String[] arr,
Wire wire)
Sets the contents of the test vector for the port identified by the String parameter. |
boolean |
test()
Runs the test specified by the vectors given with the setVector calls, using the cell given in the
setCell initialization. |
static boolean |
testingFullLibrary()
Method to query whether full library or single class is being tested. |
static void |
testOK(boolean b)
Method to inform the tester of test status. |
static void |
verboseMode(int level)
Sets the verbosity mode of the tester. 0 = quiet (minimal summary) 1 = moderate (name of each class tested, but no more) 2 = verbose (each class test is verbose) |
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 |
Constructor Detail |
public LibrarySelfTester()
public LibrarySelfTester(int verbosity)
Method Detail |
public static final void testOK(boolean b)
b
- true if current test passed.public static final boolean testingFullLibrary()
public static void verboseMode(int level)
level
- The new verbosity level of the tester.public static void setTechMapping(boolean flag)
flag
- the new value of techmap enablingpublic void setCell(Cell c)
c
- The cell to be used in the next simulation run.public void setVector(java.lang.String name, int[] arr, Wire wire)
String
parameter. The port name must
correspond to one of the ports of the cell given in the
setCell()
initialization. This version of
setVector can only be used for ports with 32 bits or less.
name
- The name of the port to be associated with this
vector of data.arr
- The array of ints to be used to drive the port.
TestException
- if vector lengths clash or port not found.public void setVector(java.lang.String name, long[] arr, Wire wire)
String
parameter. The port name must
correspond to one of the ports of the cell given in the
setCell()
initialization. This version of
setVector can only be used for ports with 64 bits or less.
name
- The name of the port to be associated with this
vector of data.arr
- The array of longs to be used to drive the port.
TestException
- if vector lengths clash or port not found.public void setVector(java.lang.String name, int[][] arr, Wire wire)
String
parameter. The port name must
correspond to one of the ports of the cell given in the
setCell()
initialization. This version of
setVector can be used for ports with any width port.
name
- The name of the port to be associated with this
vector of data.arr
- The 2-D array of ints to be used to drive the port.
TestException
- if vector lengths clash or port not found.public void setVector(java.lang.String name, java.lang.String[] arr, Wire wire)
String
parameter. The port name must
correspond to one of the ports of the cell given in the
setCell()
initialization. This version of
setVector can be used for ports with any width port.
name
- The name of the port to be associated with this
vector of data.arr
- The array of Strings parseable by BV to be used to drive the port.
TestException
- if vector lengths clash or port not found.public boolean test()
setVector
calls, using the cell given in the
setCell
initialization.
TestException
- if test cannot be started.public void clock()
clock
in interface Clockable
clock
in class Structural
public void reset()
reset
in interface Clockable
reset
in class Structural
protected abstract java.lang.String getLibraryPackageName()
protected abstract TechMapper getLibraryTechMapper()
public static void main(java.lang.String[] argv)
public final void fullTest(java.lang.String[] argv)
[-v[{0|1|2}]] [startindex [stopindex]]
-v determines verbosity, default is level 0 (see verboseMode
).
startindex and stopindex allow the testing of a subset of the testlist.
- Parameters:
argv
- parameters to parse regarding verbosity, test ranges.
- Throws:
TestException
- if any test fails, or arguments cannot be parsed.
protected abstract java.lang.String[] getTestlist()
public java.lang.String getSyntax()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |