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

Simplify and fully specify xscratchcsw[l] #416

Open
Timmmm opened this issue Sep 23, 2024 · 0 comments
Open

Simplify and fully specify xscratchcsw[l] #416

Timmmm opened this issue Sep 23, 2024 · 0 comments
Assignees
Labels
v1.0 resolve for 1.0

Comments

@Timmmm
Copy link

Timmmm commented Sep 23, 2024

I think the specification for xscratchcsw[l] could be significantly simplified and tightened up to avoid implementation defined behaviour by changing it to be something like this:

xscratchcsw and xscratchcswl have behaviour that depends on a condition, respectively:

  • the current privilege is not equal to the previous privilege
  • the current interrupt level ....

If the condition is true, then csr* rd, xscratchcsw[l], rs1/imm behaves the same as csr* rd, xscratch, rs1/imm. Otherwise it behaves the same as mv rd, rs1/imm.

This is way simpler to understand, and avoids all of the ambiguity around csrs and csrc. It's the most obvious thing to do, and it is also what we have implemented in the Sail model (not upstreamed yet) and in our designs.

Potentially something similar could be done for xnxti but I haven't fully understood that bit of the spec yet.

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

3 participants