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

Specify the interaction between CSRRS/C and "reads as" bits #1581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/zicsr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ treated as a bit mask that specifies bit positions to be cleared in the
CSR. Any bit that is high in _rs1_ will cause the corresponding bit to
be cleared in the CSR, if that CSR bit is writable.

[NOTE]
====
Since CSRRS and CSRRC perform a read-modify-write, any bits that read as
a different value to their underlying value may be modified by these
instructions even if the corresponding bit is not set in _rs1_. For example
pmpaddr[G-1] may have an underlying value of 1 but read as 0. Executing
CSRRC or CSRRS to modify a different bit will cause 0 to be read from
pmpaddr[G-1] and then written back, updating the underlying value to 0.
====

For both CSRRS and CSRRC, if _rs1_=`x0`, then the instruction will not
write to the CSR at all, and so shall not cause any of the side effects
that might otherwise occur on a CSR write, nor raise illegal-instruction
Expand Down
Loading