Skip to content

Commit dd08a52

Browse files
committed
riscv: add mseccfgh unit tests
Adds basic unit tests for the `mseccfgh` CSR register.
1 parent 3849dd5 commit dd08a52

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

riscv/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1919
- New `riscv::register::xip::clear_pending` atomic function for `mip` and `sip` registers.
2020
This function is marked as `unsafe`, as its availability depends both on the target chip
2121
and the target interrupt source.
22+
- Add `mseccfg` CSR
23+
- Add `mseccfgh` CSR
2224

2325
### Changed
2426

riscv/src/register/mseccfgh.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,17 @@ read_write_csr_field! {
1818
pmm,
1919
PMM: [0:1],
2020
}
21+
22+
#[cfg(test)]
23+
mod tests {
24+
use super::*;
25+
26+
#[test]
27+
fn test_mseccfgh() {
28+
let mut mseccfgh = Mseccfgh::from_bits(0);
29+
30+
test_csr_field!(mseccfgh, pmm: PMM::Disabled);
31+
test_csr_field!(mseccfgh, pmm: PMM::EnabledXlen57);
32+
test_csr_field!(mseccfgh, pmm: PMM::EnabledXlen48);
33+
}
34+
}

0 commit comments

Comments
 (0)