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

Write side-effects for csrrs rd, mnxti, rs1 when rs1 is not x0 #415

Open
MarkHillCodasip opened this issue Sep 18, 2024 · 1 comment
Open
Assignees
Labels
v1.0 resolve for 1.0

Comments

@MarkHillCodasip
Copy link

The spec says it follows the usual CSR conventions for write side-effects when accessing xnxti:

NOTE: Following the usual convention for CSR instructions, if the CSR

The "usual CSR conventions" are defined in the ISA Volume 1 Spec which says that write-side effects occur whenever rs1 is not x0 even if the register contents is zero:

"Note that if rs1 specifies a register other than x0, and that register holds a zero value, the instruction will not action any
attendant per-field side effects, but will action any side effects caused by writing to the entire CSR."

In particular, when following the usual CSR conventions the occurrence of a write-side effect can be determined purely by decoding the opcode and no read of the source operands is needed to detect this.

However this seems to be contradicted by the pseudo code that includes a check for rs1[4:0] being non-zero:

if (rs1[4:0] != 0 && rs1 != x0) { // Side-effects should occur.

I'd suggest reducing this line just to "if (rs1 != x0)"

@jb-brelot-nxp
Copy link
Collaborator

need to be updated in two places.

WIl lcare about this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.0 resolve for 1.0
Projects
None yet
Development

No branches or pull requests

2 participants