-
Notifications
You must be signed in to change notification settings - Fork 187
Implement DPC CSR for RISC-V #368
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
base: master
Are you sure you want to change the base?
Conversation
romancardenas
left a comment
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.
LGTM
|
Great! @romancardenas is there any improvements to be made? |
|
Let's leave a few days in case someone from the WG wants to do a second review. |
|
Alright! no probs :) either way that would ensure a clean implementation! |
rmsyn
left a comment
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.
Small non-blocking suggestions, otherwise LGTM.
| read_write_csr! { | ||
| /// Debug PC Register | ||
| Dpc: 0x7b1, | ||
| mask: !1usize, |
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.
What are you basing this alignment on?
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 Debug Spec defines dpc as holding the address of the next instruction, and according to the base ISA alignment rules (for the C extension), instruction addresses are always 2-byte aligned.
So, bit 0 of dpc is always 0, which is why the mask !1usize is applied. Hope this clears out what you were concerned about :)
Co-authored-by: rmsyn <117854522+rmsyn@users.noreply.github.com>
This PR implements the
DPCCSR for RISC-VRelated to #1