CYCLE
RWCycle count value
CYCLE (bits 63:0) — Cycle count value.
What This Field Controls
- - Cycle count value
Common Values
This field is better understood together with surrounding context than as a fixed memorized enumeration.
Machine cycle counter; RW in M-mode, counts clock cycles executed by the processor core on which the hart runs.
Cycle count value
CYCLE (bits 63:0) — Cycle count value.
This field is better understood together with surrounding context than as a fixed memorized enumeration.
mcycle is the M-mode RW cycle counter at 0xB00. It is 64 bits on RV32 and RV64 and counts clock cycles executed by the hart's processor core.
Read mcycle in M-mode to obtain the current cycle count.
When writing it, account for the write taking effect after that CSR instruction completes.
Configure mcountinhibit.CY to stop incrementing; it affects incrementing, not accessibility.
Do not decide from the CSR name alone. The official CSR address encoding and tables define the lowest access privilege; this entry records mcycle as Machine. Access with insufficient privilege or to an unimplemented CSR raises an illegal-instruction exception.
A write takes effect after the writing CSR instruction has otherwise completed. mcycle may be shared by harts on one core, so the write can be visible to those harts.