Skip to content

[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:

  1. 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 in PRELOAD plus-arg. (vcs_uvm_run): Pass tohost address as plus-arg.
  1. Fix typing issue in custom syscall code.
  • cva6/tests/custom/common/syscalls.c (syscall): Widen value of magic_memafter converting it to native unsigned int type.
  1. 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 and magic_mem conventions. Make magic_mem elements XLEN bits wide. Clear the upper 16 bits of value to be stored into tohost. (tohost_exit): Write "test result" value (left-shifted by 1 and OR-ed with 0x1) into tohost instead of executing an ECALL instruction.
  1. 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

Merge request reports

Loading