-
Notifications
You must be signed in to change notification settings - Fork 79
Add DCSR and DPC CSRs #614
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 DCSR and DPC CSRs #614
Conversation
|
For core debug registers like DCSR and DPC, it’s stated that “these registers are only accessible from Debug Mode” (Section 4.9, debug specs). What would be the correct priv_mode for those CSRs? Debug mode isn’t one of the options in the schema (only M, S, U, VS). |
Hmm. The Priv spec 1.3 "Debug Mode" says:
That sounds like a full Mode (capital M). It probably needs to be treated as such, adding a new mode in Some additional information: These 3 bits appear to be the concatenation of MPV and MPP, or at least they line up that way in the Priv spec, 18.4.1 "Machine Status Registers (mstatus and mstatush)", table 32: It may be that you could just pick a random new enum value (prepend a 4th bit, like |
|
Yea, we do need to add D-mode in globals.isa, and yes, there are cases where we are relying on the encoding of PrivilegeMode being the table Paul added above. For example: riscv-unified-db/arch/isa/globals.isa Lines 628 to 634 in 00f1540
As such, we should encode D as 0b1011 since it is M (0b0011) with extra permission. |
|
One of the regression tests is failing: Might need a hint from @dhower-qc here, but adding DXLEN support might also include:
|
|
The regressions are failing because of the various places we've assumed that MXLEN is the fundamental XLEN of the machine. We either need to fix that, or... I wonder if DXLEN can ever be > than MXLEN? The spec states that DXLEN is:
That seems to be accounting for the fact that misa.MXL used to be mutable. But the spec was amended to make that impossible. As such, I have trouble imagining any use for a machine where MXLEN == 32 and DXLEN == 64. And it's not worth implementing a DXLEN > MXLEN for the old spec where misa.MXL could change, since the assumption is there are zero implementations out there that do it (it was never well-enough defined anyway). My vote is to drop DXLEN, and get clarification from the debug spec that DXLEN is always identical to MXLEN. |
Per Paul Donahue (Ventana, author of the Debug spec):
|
|
Thanks for the feedback! I'll remove the DXLEN code and use MXLEN for |
Excellent. That's going save us a few headaches. |
|
@neverlandiz, if you are willing to make a few more changes:
If you are sufficiently tired of this PR and want to see it merged and move on with your life, we can merge this and open an issue, or we can take on our own commits here. What's your preference? (No worries either way, honestly.) |
|
@ThinkOpenly I'd be happy to make the changes! I plan on finishing the PRs that I have opened. |
|
So, now that #797 has been merged, we need a major rebase:
|
Signed-off-by: Katherine Hsu <[email protected]>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
@dhower-qc can we merge this? We got a request to work on #215, but this PR covers a lot of that work. |
This PR addresses Issue #570 and adds the remaining missing debug CSRs - DCSR - DPC --------- Signed-off-by: Katherine Hsu <[email protected]> Co-authored-by: Derek Hower <[email protected]>
This PR addresses Issue riscv-software-src#570 and adds the remaining missing debug CSRs - DCSR - DPC --------- Signed-off-by: Katherine Hsu <[email protected]> Co-authored-by: Derek Hower <[email protected]>

This PR addresses Issue #570 and adds the remaining missing debug CSRs