Skip to content

Fix rvfi exception decoding#3245

Merged
JeanRochCoulon merged 2 commits into
openhwgroup:masterfrom
DymShanks:fix-rvfi-exception-decoding
Apr 13, 2026
Merged

Fix rvfi exception decoding#3245
JeanRochCoulon merged 2 commits into
openhwgroup:masterfrom
DymShanks:fix-rvfi-exception-decoding

Conversation

@DymShanks
Copy link
Copy Markdown
Contributor

This PR addresses the missing Sv39 page-fault cause decodings in the RVFI tracer reported in #3239.

While implementing the fix, I audited the case statement against the RISC-V Privileged Architecture Specification and noticed that the U-mode and S-mode Environment Calls were also missing. I have added them alongside the page faults to ensure the tracer's logging is comprehensive.

Changes Made in corev_apu/tb/rvfi_tracer.sv:

  • Added Sv39 Page Faults: INSTR_PAGE_FAULT (0xc), LOAD_PAGE_FAULT (0xd), and STORE_PAGE_FAULT (0xf).
  • Added Environment Calls: ENV_CALL_UMODE (0x8) and ENV_CALL_SMODE (0x9).
  • Ensured strict alignment and formatting parity with the existing codebase.

Related Issue

Fixes #3239 (Thanks to @sjo99-kr for the catch!)

- test: M_RW_CSR
iterations: 1
<<: *common_test_config
# Prerequisite: install riscv-arch-test (== run 'cva6/regress/install-riscv-arch-test.sh') first.
Copy link
Copy Markdown
Contributor

@JeanRochCoulon JeanRochCoulon Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my mind, the asm tests does not depend on riscv-arch-test. I you agree, could you remove these comments ?

@@ -0,0 +1,91 @@
## // Copyright 2023 Thales
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to get this yaml testlist file, but what is the relation with the rvfi_tracer modification ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JeanRochCoulon, sorry for the confusion! I accidentally branched off my local fix for #3223 instead of a clean master.

I just force-pushed to clean up the history. This PR is now strictly just the rvfi_tracer.sv changes for #3239.

(Note: I also removed that riscv-arch-test comment you mentioned over in PR #3229 where that YAML file actually belongs).

Resolves openhwgroup#3239 by adding missing exception decodings (Sv39 page faults and U/S-mode ecalls) mapped to their standard strings for better simulation logging.
@DymShanks DymShanks force-pushed the fix-rvfi-exception-decoding branch from e96f00e to aa15019 Compare April 13, 2026 17:38
@JeanRochCoulon
Copy link
Copy Markdown
Contributor

Thanks @DymShanks
I will merge as soon as CIs are green

@github-actions
Copy link
Copy Markdown
Contributor

❌ failed run, report available here.

@JeanRochCoulon JeanRochCoulon merged commit 6779dac into openhwgroup:master Apr 13, 2026
12 checks passed
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.

[BUG] Missing page-fault cause decoding in RVFI tracer

2 participants