ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

mcycle

T1 riscv register register
Machine Cycle Counter
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (Sm)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeM
ExtensionsSm

Summary

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.

Syntax / Encoding

CSR 0xb00 (M-mode, RW)

Bitfields (1)

BitsFieldDescription
63:0COUNTCycle counter. <%- if ext?(:Zicntr) -%> Aliased as cycle.COUNT. <%- end -%> Increments every cycle unless: * mcountinhibit.CY <%- if ext?(:Smcdeleg) -%>or its alias scountinhibit.CY<%- end -%> is set <%- if ext?(:Smcntrpmf) -%> * mcyclecfg.MINH is set and the current privilege level is M <%- if ext?(:S) -%>

Reference Notes

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.