Skip to content

Commit 4145e4a

Browse files
Merge #57
57: Add mcounteren.rs, cycle[h].rs, instret[h].rs, and update mod.rs r=Disasm a=dkhayes117 I'm not sure the set_clear_csr!() macros are correct in mcounteren.rs. I get a build error that says `cannot find function `_clear` in this scope` Co-authored-by: dkhayes117 <dkhayes117@yahoo.com>
2 parents 39ff09e + 1c6fd6c commit 4145e4a

File tree

9 files changed

+923
-128
lines changed

9 files changed

+923
-128
lines changed

src/register/cycle.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! cycle register
2+
//! Shadow of mcycle register
3+
//! must have `scounteren::cy` or `mcounteren::cy` bit enabled depending on whether
4+
//! S-mode is implemented or not
5+
6+
read_csr_as_usize!(0xC00, __read_cycle);
7+
read_composite_csr!(super::cycleh::read(), read());

src/register/cycleh.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//! cycleh register
2+
//! Shadow of mcycleh register (rv32)
3+
//! must have `scounteren::cy` or `mcounteren::cy` bit enabled depending on whether
4+
//! S-mode is implemented or not
5+
6+
read_csr_as_usize_rv32!(0xC80, __read_cycleh);

0 commit comments

Comments
 (0)