Machine Cycle Counter
Counts the number of clock cycles executed by the processor core on which the hart is running. The counter has 64-bit precision on all RV32 and RV64 harts.
The `mcycle` CSR may be shared between harts on the same core, in which case writes to `mcycle` will be visible to those harts. The platform should provide a mechanism to indicate which harts share an `mcycle` CSR.
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| COUNT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| [63:0] | COUNT | ['cycle.COUNT'] | Cycle counter. Aliased as `cycle.COUNT`. Increments every cycle unless: * `mcountinhibit.CY` or its alias `scountinhibit.CY` is set * `mcyclecfg.MINH` is set and the current privilege level is M * `mcyclecfg.SINH` or its alias `cyclecfg.SINH` is set and the current privilege level is (H)S * `mcyclecfg.UINH` or its alias `cyclecfg.UINH` is set and the current privilege level is U * `mcyclecfg.VSINH` or its alias `cyclecfg.VSINH` is set and the current privilege level is VS * `mcyclecfg.VUINH` or its alias `cyclecfg.VUINH` is set and the current privilege level is VU | RW-RH | UNDEFINED_LEGAL |
# since the counter may be shared among harts, reads must be handled # as a builtin function return read_mcycle();
Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.