Skip to content

[DRAFT] RVH-tests#3246

Draft
NicolasDerumigny wants to merge 12 commits into
openhwgroup:masterfrom
NicolasDerumigny:dev/nderumig/rvh-tests
Draft

[DRAFT] RVH-tests#3246
NicolasDerumigny wants to merge 12 commits into
openhwgroup:masterfrom
NicolasDerumigny:dev/nderumig/rvh-tests

Conversation

@NicolasDerumigny
Copy link
Copy Markdown
Contributor

@NicolasDerumigny NicolasDerumigny commented Mar 24, 2026

First draft of our RVH testing c-test suite, implemented in verif/tests/custom/rvh and triggered by verif/regress/hypervisor-tests-cv64a6_imafdch_sv39.sh.

It features:

  • paging tests in host mode (S-mode)
  • paging tests in host mode (U-mode)
  • paging tests in virtual mode (VS-mode), both at hgatp and vsatp level (guest and host page table)

This is by far not exhaustive of all H-Mode quirks, and is only SV39 (64-bit) compliant.

cva6.py, Makefile, ariane_testharness.sv, ariane_tb.cpp and various project files were modified to:

  • execute prints from the verilator harness: a from_host value is added along with the to_host, to answer on syscall completion. This requires CBO operations and HPDCache to ensure that the cache do not interfere on read/writes to these values.
  • explicitly support/show hart id (not very relevant here, but we use it on our fork).
  • allow diff of the output print between spike and verilator (with an additional option to cva6.py).
  • allow diff between verilator and a reference file containing regular expressions (unused in this PR) (with an additional option to cva6.py).
  • add a --no-ecall-exit-marker as ecalls seem to trigger exits on one tool (VCS?) but are required in our H-Mode test suite.

Also:

  • verible-format was run on ariane_testharness.sv, resulting in (lots of) formatting changes.
  • verible-format was run on corev_apu/tb/rvfi_tracer.sv, resulting in (lots of) formatting changes.
  • VS-mode tests require fix: no error on h-mode SV39x4 translation #3221 to pass, so this PR is based on the top of it

The goal of this PR is to know what need to be kept, what breaks the current CI and what should be saved for final merge, as discussed in last weekly meeting.

@cainria
Copy link
Copy Markdown
Contributor

cainria commented Mar 24, 2026

Please convert your PR to a Draft PR (below the list of reviewers in the right column of this page). It will prevent from an accidental merge.

@NicolasDerumigny NicolasDerumigny marked this pull request as draft March 24, 2026 17:44
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi there!

This pull request seems inactive. Need more help or have updates? Feel free to let us know. If there are no updates within the next few days, we'll go ahead and close this PR. 😊

@github-actions github-actions Bot added the Status:Stale Issue or PR is stale and hasn't received any updates. label Apr 24, 2026
@github-actions github-actions Bot removed the Status:Stale Issue or PR is stale and hasn't received any updates. label Apr 25, 2026
@NicolasDerumigny NicolasDerumigny force-pushed the dev/nderumig/rvh-tests branch from b4ec4ae to 37c78c1 Compare May 19, 2026 09:59
@NicolasDerumigny
Copy link
Copy Markdown
Contributor Author

I have updated the PR to be rebased on the top of #3221, and removed the useless multicore support in cva6.py. It should be now much clearer to read!

@NicolasDerumigny NicolasDerumigny force-pushed the dev/nderumig/rvh-tests branch from 37c78c1 to 33965df Compare May 19, 2026 10:27
@NicolasDerumigny
Copy link
Copy Markdown
Contributor Author

I cannot see the failure log of the CI, is this expected?

@cainria
Copy link
Copy Markdown
Contributor

cainria commented May 19, 2026

Tue, 19 May 2026 10:31:43 INFO     [veri-testharness] Running ISS simulation: /home/runner/work/cva6/cva6/verif/sim/out_2026-05-19/directed_tests/cadd-01.o ...done

Tue, 19 May 2026 10:31:43 INFO     Incomplete TANDEM YAML report
Tue, 19 May 2026 10:31:43 INFO     Processing verilator log : /home/runner/work/cva6/cva6/verif/sim/out_2026-05-19/veri-testharness_sim/rv32im-cadd-01.cv32a65x_hart_00.log

/home/runner/work/cva6/cva6/verif/sim/out_2026-05-19/directed_tests/cadd-01.o
/home/runner/work/cva6/cva6/verif/sim/out_2026-05-19/directed_tests/cadd-01.o
Traceback (most recent call last):
  File "/home/runner/work/cva6/cva6/verif/sim/cva6.py", line 1352, in <module>
    main()
  File "/home/runner/work/cva6/cva6/verif/sim/cva6.py", line 1313, in main
    run_test(path_test, args.iss_yaml, args.isa, args.target, args.mabi, gcc_opts,
  File "/home/runner/work/cva6/cva6/verif/sim/cva6.py", line 557, in run_test
    tandem_postprocess(yaml, target, isa, test_log_name, log, testlist, iss,
  File "/home/runner/work/cva6/cva6/verif/sim/cva6.py", line 421, in tandem_postprocess
    process_verilator_sim_log(logfile + ".log", logfile + ".csv", exit_on_ecall=exit_on_ecall)
  File "/home/runner/work/cva6/cva6/verif/sim/verilator_log_to_trace_csv.py", line 209, in process_verilator_sim_log
    for (entry, illegal) in read_verilator_trace(verilator_log, full_trace, exit_on_ecall):
  File "/home/runner/work/cva6/cva6/verif/sim/verilator_log_to_trace_csv.py", line 125, in read_verilator_trace
    with open(path, 'r') as handle:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/cva6/cva6/verif/sim/out_2026-05-19/veri-testharness_sim/rv32im-cadd-01.cv32a65x_hart_00.log'

Did you change the RVFI output file path?

@NicolasDerumigny
Copy link
Copy Markdown
Contributor Author

Yes. I splitted output into .log and .out with .log being the old one without extension, and .out everything output by verilator during execution (internal messages + output of "printf"). Is there a way to run tandem locally? I cannot reproduce it using solely sim/verif/dv-riscv-arch-test.

@cainria
Copy link
Copy Markdown
Contributor

cainria commented May 20, 2026

Have you set SPIKE_TANDEM to 1 in the environment?

SPIKE_TANDEM: 1

@NicolasDerumigny NicolasDerumigny force-pushed the dev/nderumig/rvh-tests branch from 33965df to 2a63996 Compare May 22, 2026 13:20
@NicolasDerumigny NicolasDerumigny force-pushed the dev/nderumig/rvh-tests branch from 2a63996 to b417029 Compare May 22, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants