CSR Bit Fields

RISC-V mcycleh CSR Register

Address 0xB80Privilege MachineAccess RW / RV32 high-half / 32-bitMachine counters and performance-monitoring CSRs

mcycleh at 0xB80 exists only on RV32 and provides bits 63:32 of mcycle; it is not a separate counter.

Bit Overview
bit 3 = only bit 3; bits 12..11 = bits 12 down to 11
MSBLSB
Field Map

Understand mcycleh By Bit Fields

0 key fields
Official Basis & Search Notes

mcycleh is the RV32-only upper-half access window for mcycle: it reads and writes bits 63:32 of the same 64-bit cycle counter, not a separate counter.

The CSR table lists 0xB80 as the RV32-only Machine read/write upper 32 bits of mcycle.
On RV32, mcycleh accesses only mcycle bits 63:32; it does not exist on RV64.

What To Check First When Reading This CSR

  • - mcycleh exists only on RV32: mcycle reads bits 31:0 and mcycleh reads bits 63:32.
  • - When reading the incrementing 64-bit counter, use a high-low-high stable-read sequence to avoid combining values across a low-half carry.

Risk Checks Before Writing

  • - A write to mcycleh changes only mcycle bits 63:32 and takes effect after the writing instruction has otherwise completed.
  • - Do not treat it as an independent counter; this CSR does not exist on RV64.

Put It Back Into A Real Flow

1

On RV32, read mcycleh, then mcycle, then mcycleh again.

2

Retry if the high halves differ; otherwise the halves form one 64-bit mcycle value.

FAQ

Is mcycleh a separate counter?

No. On RV32 it accesses bits 63:32 of the same mcycle counter; mcycle accesses bits 31:0.

How is mcycle read stably on RV32?

Read high, low, then high again; retry when the high halves differ to avoid an inconsistent value across a low-half carry.