-
Notifications
You must be signed in to change notification settings - Fork 50
Add Smstateen/Ssstateen Extension and CSRs #592
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
Add Smstateen/Ssstateen Extension and CSRs #592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments in hstateen0/hstateen0h generally apply to the others as well.
Signed-off-by: Katherine Hsu <67767297+neverlandiz@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments apply to all the CSRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need an arch/ext/Ssstateen.yaml file.
I think there is already a Ssstateen.yaml file? |
You're right. Ignore my ignorance please ;) |
Interesting CI failures!
'hstateen0h
Conversely, it would seem to violate the text if I was wondering if we could implement a new "internally" visible 64-bit CSR to which they both could alias, but not sure we really want to diverge from the spec in that way. The only solution I can think of at the moment is to have Any other thoughts, @dhower-qc ? |
The spec isn't self-consistent here. It states two things simultaneously:
I think the intent is that hstateen0 is always 64 bits but that 32 aren't visible through I recommend making all the |
That's not how I read it. I read this as literal:
And this as a terse convention:
...indicating that the 32-bit high-half CSRs represent the upper 32 bits of the RV64 representations of the associated registers. ...which I think is pretty much how we all understood it, but that does force us to figure out a good representation for it. |
In case you haven't seen it, there is a related discussion about CSR registers vs CSR addresses towards the end of this issue: riscv/riscv-isa-manual#1255. |
That's a very interesting read. Thanks for the pointer, @jordancarlin! To me, that discussion pretty clearly asserts that 64-bit CSRs that, in RV32 mode, have "upper half" However, that would make the spec incorrect when it says:
"The registers listed above" are |
riscv/riscv-isa-manual#1255 turned into riscv/riscv-isa-manual#1966, so I added the observation as a comment there (riscv/riscv-isa-manual#1966 (comment)). I should probably turn the suggested text therein into a PR. |
Done: riscv/riscv-isa-manual#2066. Presuming the discussion in that issue is dispositive, I'm with Derek's suggestion above:
Nicely, this simplifies things here and elsewhere. |
You might have run into a bug in the Ruby code...
I'm not familiar with this code, but it looks like it should be "versions". @dhower-qc ? |
Running your branch with the following change got the regress-gen-isa-manual test to pass:
If you want to include that change with this PR, I would not object. |
Sounds good, I'll add that change then. |
ping @dhower-qc |
This PR addresses Issue #547 and adds the Smstateen extension, along with the following Smstateen/Ssstateen CSRs