This repository has two available branches:
-
master: generates tests that contain self-checking. -
new_test_format: generates tests that are used for the RISCOF framework (no self-checking, use signature for verification).
The test content is the same in both of them.
-
RVV Compiler
- Set
gcc,objdump, andriscofdirectory's path variables in file:scripts/constants.py
- Set
-
VLEN config
scripts/create_test_floating/create_test_common.py_vlen =change it to your vlen
-
Spike
- Install Latest https://github.com/riscv-software-src/riscv-isa-sim.
- Add
<spike_path>/buildto your PATH
If the terminal can find
spikecommand then it's successful -
RISCV-ISAC RVV Support
git clone https://github.com/hushenwei2000/riscv-isac-rvvcd riscv-isac-rvvgit checkout vetcor!!!IMPORTANT!!!pip install . --prefix=~/.local# Anywhere you want- Add
~/.localto your PATH
If the terminal can find
riscv_isaccommand then it's successful -
Sail Reference Model (If you want to run RISCOF to test)
- Intall sail-riscv with vector support
https://github.com/riscv/sail-riscv. master branch- sail version should be
0.16 - Note that you should modify
vlenandeleninriscv_sys_control.sailafterinit_pmp()before building. Add these two lines for example:
vlen and elen encoding can be found invlen = 0b0011; elen = 0b1;riscv_vlen.sail. - sail version should be
- Intall sail-riscv with vector support
python run.py -i <instruction> -t <type> [--vlen VLEN] [--vsew VSEW]
- The type shall be consistent with the instruction: i (integer), f (floating point), m (mask), p (permute), x (fix point), l (load store)
- Supported instruction and type can be seen in
cgfs/<type>/<instruction>.yaml - vlen VLEN Vector Register Length: 32, 64, 128(default), 256, 512, 1024
- vsew VSEW Selected Element Width: 8, 16, 32(default), 64
python generate_all.py
- This will use default parameter configuration to generate all integer instructions tests.
- Modify
runcommand_<type>function to run different parameter. - Modyfy
mainfunction to run different type of instructions.
After genering, run python move_generate_all_elf.py, this will check if generated file is valid. If you see
No first.S for vXXis OK, ignore itNo RVMODEL_DATA_END for vXXthen it means vXX you should use generate one instruction method to regenerate it. Regenerate all of them and rerunmove_generate_all_elf.pyuntil noNo RVMODEL_DATA_ENDappear.- All tests will in
generate_allfolder.
-
Modify
riscof_files/env/test_macros_vector.h, you can select your prefered configuration and copy fromenv/macros/vsewXX_lmulXXand paste toriscof_files/env/test_macros_vector.h -
cd riscof_files -
Modify your reference model and DUT to be testes in
config.ini, in current file, we use sail as reference and spike as DUT -
Modify GCC in
sail_cSim/riscof_sail_cSim.pyandspike/riscof_spike.py -
copy the
.Stest files totest_suite -
Modify VLEN and ELEN argument in
riscof_files/spike/riscof_spike.pyline 166:-varch=vlen:512,elen:64 -
run
riscof run --config=config.ini --suite=test_suite --env=env
- Not support floating-point vsew=16
- Lack of vmerge tests
- Lack of load store eew=64 tests
- SEGMENT load and store signature problem: if eew > sew, only the first register will be signatured
- mask instructions lack of test different registers tests
| Parameter | Numbers | Current Support | Note |
|---|---|---|---|
| FLEN | FP16, BF16, 32, 64 | 32, 64 | |
| vlen | 128 ~ 2^16 | 128 ~ 1024 | Spike now support largest 4096 |
| vsew | 8, 16, 32, 64 | All | |
| lmul | 1/8, 1/4, 1/2, 1, 2, 4, 8 | All | lmul=8 except load/store, 1/8 except eew>=32 loadstore |
| vta | 0, 1 | 0 | |
| vma | 0, 1 | 0 |
-
elen = 64 for default
- vsew should <= elen * lmul
- So, when lmul = 0.125, load/store eew=32+ cannot test.
-
If there are failure tests, most probably is because that configuration can not be tested on that instruction. For example test widen instruction when vsew=64, or test floating point when vsew=8/16, or the elen related restriction above.
-
For arithmetic instructions that has vv, vx, vi types, each type tests store signature into x12, x20, x24, respectively.