Skip to content

csr_regfile: Fix SBE/UBE when S/U-mode disabled#3302

Open
pointerliu wants to merge 1 commit into
openhwgroup:masterfrom
pointerliu:fix-sbe-ube-csr
Open

csr_regfile: Fix SBE/UBE when S/U-mode disabled#3302
pointerliu wants to merge 1 commit into
openhwgroup:masterfrom
pointerliu:fix-sbe-ube-csr

Conversation

@pointerliu
Copy link
Copy Markdown

  • I have searched for similar pull requests
  • I am a human engaging in an interpersonal interaction. During this interaction, my words are my own and are not generated. If relevant, I provide links to my sources.

According to RISC-V privileged spec, SBE must be read-only 0 when S-mode is not supported, and UBE must be read-only 0 when U-mode is not supported. Previously MBE was mirrored to SBE and UBE unconditionally, which could set them to 1 even when the corresponding privilege mode was absent.

Now the mirroring is conditional on CVA6Cfg.RVS and CVA6Cfg.RVU respectively, hardwiring to 0 when the mode is not supported.

Fix #3301

According to RISC-V privileged spec, SBE must be read-only 0 when
S-mode is not supported, and UBE must be read-only 0 when U-mode
is not supported. Previously MBE was mirrored to SBE and UBE
unconditionally, which could set them to 1 even when the
corresponding privilege mode was absent.

Now the mirroring is conditional on CVA6Cfg.RVS and CVA6Cfg.RVU
respectively, hardwiring to 0 when the mode is not supported.
@pointerliu pointerliu requested a review from JeanRochCoulon as a code owner May 6, 2026 08:41
@JeanRochCoulon
Copy link
Copy Markdown
Contributor

Hello @pointerliu
Please sign the ECA-Eclipse agreement to become contributor

@pointerliu
Copy link
Copy Markdown
Author

Hi @JeanRochCoulon, I've signed the ECA using the same email as github. Please let me know if anything else is needed. Thanks!

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] SBE/UBE incorrectly mirror MBE when S-mode/U-mode are not supported

2 participants