[WIP - do not merge] Preview of unified Spike-like termination infrastructure
Created by: zchamski
This PR implements the HTIF-style "write-to-tohost
" termination protocol for tests and supplies simulation sessions with sufficient information to let the RVFI tracer of CVA6 retrieve the actual address of tohost
for an orderly termination.
The changes come in four sets:
- Align 'tohost' addr passing in VCS and Verilator.
- cva6/sim/Makefile (vcs-testharness): Pass
tohost
address as plus-arg. (veri-testharness): Pass ELF file name inPRELOAD
plus-arg. (vcs_uvm_run): Passtohost
address as plus-arg.
- Fix typing issue in custom syscall code.
- cva6/tests/custom/common/syscalls.c (syscall): Widen value of
magic_mem
after converting it to native unsigned int type.
- Update custom BSP code to better match HTIF conventions: Signal termination by writing non-zero value into
tohost
, fix sizes of variables.
- cva6/tests/custom/common/syscalls.c (syscall): Document syscall-related
tohost
andmagic_mem
conventions. Makemagic_mem
elements XLEN bits wide. Clear the upper 16 bits of value to be stored intotohost
. (tohost_exit): Write "test result" value (left-shifted by 1 and OR-ed with 0x1) intotohost
instead of executing anECALL
instruction.
- Add Spike patch with hooks for managing test termination from RTL.
- cva6/regress/install-spike.sh: Install RTL termination hooks patch.
- cva6/regress/spike/patches/rtl-termination-hooks.patch: New.
Signed-off-by: Zbigniew Chamski zbigniew.chamski@thalesgroup.com