Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't read CSR in csrrw(i) with rd=0 #1628

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShengMingTangAndes
Copy link

According to
The RISC-V Instruction Set Manual Volume I: Unprivileged ISA Document Version 20191213 Table 9.1,
there are some conditional with rd = 0 that inhibit read on CSRs.
螢幕擷取畫面 2024-03-19 110524

Though original implementation is correct in most cases, this always-read implementation may cause some effects. For example, some CSRs that read-write to it may change the architectural state.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

No standard CSRs have read side effects, so this doesn't matter. It's just extra complexity for no benefit.

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.

None yet

2 participants