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

riscv: define medeleg using CSR macros #235

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

rmsyn
Copy link
Contributor

@rmsyn rmsyn commented Oct 27, 2024

Uses CSR helper macros to define the medeleg register.

Adds basic unit tests for the medeleg register.

Related: #229

@rmsyn rmsyn requested a review from a team as a code owner October 27, 2024 20:44
rmsyn added 2 commits October 27, 2024 20:47
Uses CSR helper macros to define the `medeleg` register.
Adds basic unit tests for the `medeleg` register.
@rmsyn rmsyn force-pushed the riscv/medeleg-csr-macro branch from 08b6b0e to 8fad75f Compare October 27, 2024 20:48
Copy link
Contributor

@romancardenas romancardenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!!

I understand that previously there were no setters in the Medeleg, right?

BTW: I like the approach of adding simple unit tests for these register proxies

@rmsyn
Copy link
Contributor Author

rmsyn commented Oct 28, 2024

I understand that previously there were no setters in the Medeleg, right?

Correct, there were no setters. I didn't know if this was intentional, because of the set_ and clear_ free functions.

medeleg is a read-write register from the spec, so I figured adding the setters was the way to go. Am I mistaken?

BTW: I like the approach of adding simple unit tests for these register proxies

❤️

@romancardenas
Copy link
Contributor

Probably there weren't getter/setters because of the atomic set_* functions. However, with these new setters via a proxy, we can modify the medeleg CSR with just one write to the actual register.

@romancardenas romancardenas added this pull request to the merge queue Oct 29, 2024
Merged via the queue into rust-embedded:master with commit 275facc Oct 29, 2024
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants