Project Test Programs
1. Unit Tests
All programs can also be accessed through the file system at this relative path (rooted at wherever you cloned the repo). Rest of this document with you /wiscv for simplicity to refer to this location.
/wiscv/tests
Currently, we only expect you to pass all the tests from this directory. We are currently working on bringing the tests in the project git repo into parity with the existing 552 WISC ISA tests.
To run the tests, go to the /wiscv/tb
directory and run make all PROG=(program name) MODE=(processor type, either pipe or nopipe)
. The results of the test will be found in a generated directory in /wiscv/tb
.
Note: The name of the generated folder can be specified by modifying the RUN_DIR
flag. Also, the program name you need to enter is just the name of the file. You SHOULD NOT include the extension.
2. Regression Tests
In order to run all of the tests easily, the included makefile has a regression testing option.
To use the regression test mode run make all_regr REGR_TL=(testlist name)
from /wiscv/tb
. This will run all of the included tests specified by the testlist name. There are two provided testlists, unit_tests
and random_tests
(specified in the /wiscv/tests/testlists/*.tl
file). Running this command will automatically generate a test directory where the results of the regression testing can be found.
Note: The name of the generated folder can be specified by modifying the RUN_DIR
flag. You should also specify what mode you are running the processor in with the MODE
flag as shown in the unit tests section.
3. Adding Your Own Tests
To add your own custom tests, which is required for the pipelined phase of the project, you should create a new directory in the /wiscv/tests
directory (the name doesn't matter).
When you add a .s
assembly file to this new directory, the test will have to follow certain guidelines in order to be run by the processor framework.
- Add these two lines to the top of the
.s
file:
- Next, add the body of the assembly code, making sure to indent the code relative to the first two lines
- End the body of the assembly code with
j exit
- At the end of your assembly program, add:
- To run this program, run
make all PROG=your-prog-name
from the /wiscv/tb
directory