Skip to content

Commit ac863e8

Browse files
Merge pull request #419 from sbutz/stimecmp
riscv: Add stimecmp CSR
2 parents 447c907 + d3ca0fc commit ac863e8

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

riscv/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12+
- Add `stimecmp`/`stimecmph` CSRs
1213
- Add `tselect`, `tdata2` and `tdata3` Sdtrig CSRs as raw `read_write_csr_as_usize!` accessors, and `tdata1` and `tcontrol` as typed CSRs with field accessors.
1314
- Add `read_bits`/`try_read_bits` and `write_bits`/`try_write_bits` to the modules generated by `read_csr_as_usize!` and `write_csr_as_usize!`, as aliases of `read`/`write` so that a generated CSR module offers the same raw accessors no matter which macro defined it.
1415
- Add `read_bits`/`try_read_bits` and `write_bits`/`try_write_bits` to the CSR modules generated by `read_write_csr!` `read_only_csr!` and `write_only_csr!`.

riscv/src/register.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ pub mod miselect;
134134
pub mod sireg;
135135
pub mod siselect;
136136

137+
// Supervisor timer interrupts
138+
pub mod stimecmp;
139+
#[cfg(any(test, target_arch = "riscv32"))]
140+
pub mod stimecmph;
141+
137142
// Virtual supervisor indirect access
138143
pub mod vsiselect;
139144

riscv/src/register/stimecmp.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//! stimecmp register
2+
3+
read_csr_as_usize!(0x14D);
4+
write_csr_as_usize!(0x14D);
5+
read_composite_csr!(super::stimecmph::read(), read());
6+
write_composite_csr!(super::stimecmph::write, write);

riscv/src/register/stimecmph.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! stimecmph register
2+
3+
read_csr_as_usize_rv32!(0x15D);
4+
write_csr_as_usize_rv32!(0x15D);

0 commit comments

Comments
 (0)