Skip to content

register: add mtinst register #291

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

Merged
merged 3 commits into from
Jun 2, 2025

Conversation

rmsyn
Copy link
Contributor

@rmsyn rmsyn commented May 25, 2025

Adds the definition for the mtinst Machine trap instruction CSR.

Adds a test macro branch for multi-bit register fields.

Minor correction to the single-bit test macro for not assuming the field's initial value.

Adds basic unit tests for the mtinst CSR.

Related: #1

Adds the definition for the `mtinst` Machine trap instruction CSR.
@rmsyn rmsyn requested a review from a team as a code owner May 25, 2025 01:04
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.

LGTM! it seems that there is a redundant check in the tests

let exp_val = (bits & (mask << $start)) >> $start;

$crate::paste! {
assert_eq!(exp_val, exp_val);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I missed it when doing a search-replace from an earlier version of the macro arm.

I fixed it 😓

@rmsyn rmsyn force-pushed the riscv/register/mtinst branch from ae83f9e to 57fec49 Compare May 30, 2025 23:43
rmsyn added 2 commits May 30, 2025 23:45
Adds a test macro branch for multi-bit register fields.

Minor correction to the single-bit test macro for not assuming the
field's initial value.
Adds basic unit tests for the `mtinst` CSR.
@rmsyn rmsyn force-pushed the riscv/register/mtinst branch from 57fec49 to 5fc8d77 Compare May 30, 2025 23:46
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.

LGTM

@romancardenas romancardenas added this pull request to the merge queue Jun 2, 2025
Merged via the queue into rust-embedded:master with commit 74c2091 Jun 2, 2025
138 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