Conversation
Explicitly define reserved/WPRI bits in mnstatus.yaml to remove architectural assumptions in the database. Also update .gitignore to exclude docker artifacts. Closes riscv#1186
AFOliveira
left a comment
There was a problem hiding this comment.
Thanks for the contribution! This is new to UDB and may need some discussion. but if you're willing to wait and see, I think this is already along the lines of what to insert, I'm just not sure about the how. @ThinkOpenly and @dhower-qc have worked with CSRs inside UDB way more than me, so let's see what they think.
| extension: | ||
| name: Smrnmi | ||
| fields: | ||
| Reserved_High: |
There was a problem hiding this comment.
I'm not super sure about this name for the reserved, locations... @ThinkOpenly @dhower-qc, any thoughts?
There was a problem hiding this comment.
Agreed, but I don't have anything that would make it better. Other than maybe having the names with numbers match the order of "location", e.g., Reserved_4_6 --> Reserved_6_4
There was a problem hiding this comment.
Okay . I'll rename it to match the location order ( Reserved_4_6 --> Reserved_6_4 )
| extension: | ||
| name: H | ||
|
|
||
| Reserved_4_6: |
| type: RW-H | ||
| reset_value: 0 | ||
|
|
||
| Reserved_0_2: |
dhower-qc
left a comment
There was a problem hiding this comment.
The big-picture question on this is whether or not it's needed. What does explicitly naming the reserved fields add beyond just assuming that any unused bits are unnamed WPRI, as is the case now?
If I can recall correctly, the question is that reserved and WPRI mean differnt things. |
|
I thought we determined they were the same. Do you have the differing definitions? |
Going down the issue rabbit-hole, I don't think that's true. i.e.
|
|
Talked about this in the PR meeting -- general direction is that we should treat missing bits as WPRI, and only document the reserved fields that are not WPRI. Much less work! |
That's what this PR does, right? |
The guidance in the spec is:
I'm not sure I like that guidance, because it breaks forward compatibility. If I always write zeros to those bits, how can they ever be used in the future? Maybe we need to change the spec there. I think it should really be "the other bits in |
Well, I wasn't making judgments on the spec here. I understand your concern, but the spec is ratified as is, so changing that shouldn't be possible without modifying the extension number, right? So, @amkr6207 change should be in UDB as it agrees with current RISC-V specification |
|
FYI, I reopened riscv/riscv-isa-manual#2318, because the words in the spec seem wrong to me. |
I don't think it's the words. You seem to be disagreeing with the behavior, which is fine, but as of right now, I think the spec mandates what Greg described and I'm afraid that it has been implemented in real HW, so it seems to late to change it? |
I understand your point. I've reopened the issue to get more clarity, for me at least. I will note that "should" != "must". So, that would make actual behavior implementation-dependent, and thus in need of a configuration parameter. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1565 +/- ##
==========================================
+ Coverage 60.05% 69.18% +9.13%
==========================================
Files 42 43 +1
Lines 26120 27059 +939
Branches 6246 6475 +229
==========================================
+ Hits 15686 18721 +3035
+ Misses 10434 8338 -2096
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you all for the detailed feedback! Reserved vs WPRI — I see there's an ongoing discussion about whether missing bits should be treated as WPRI by default (riscv/riscv-isa-manual#2318). Should I wait for that to be resolved before extending this to other CSRs, or should I proceed with the current approach? |
I'd wait. |
This PR addresses Issue #1186 by explicitly defining all reserved/WPRI fields in
mnstatus.yamlas per the RISC-V Smrnmi specification.Changes:
Reserved_High(Bits 63-13).MNPELP(Bit 9) from Zicfilp extension.Reservedfields for all gaps (Bits 0-2, 4-6, 8, 10).Reservedfield locations to use validrv32/rv64ranges.Note: This is a pilot implementation to establish the correct pattern. Once approved, I will apply this pattern to the remaining CSR files in subsequent PRs.
Closes #1186