CSR Bit Fields

RISC-V hpmcounter25 CSR Register

Address 0xC19Privilege UserAccess RO / 64 bits (RV32 accesses the upper 32 bits through hpmcounter25h)User counters and performance-monitoring CSRs

hpmcounter25 is a Zihpm user-level read-only hardware performance counter; its event, implemented count, and width are platform-specific.

Field Map

Understand hpmcounter25 By Bit Fields

1 key fields
63:0

VALUE

RO

hpmcounter25 reads the complete 64-bit count on RV64; the implemented count, width, and events are platform-specific.

VALUE (bits 63:0) — hpmcounter25 reads the complete 64-bit count on RV64; the implemented count, width, and events are platform-specific.

What This Field Controls

  • - hpmcounter25 reads the complete 64-bit count on RV64; the implemented count, width, and events are platform-specific.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
Official Basis & Search Notes

hpmcounter25 is the Zihpm user read-only counter at 0xC19. Its event, implemented count, and width are platform-specific; hpmcounter25h provides the RV32 upper 32 bits.

hpmcounter25 is URO at 0xC19 in the official CSR table and is a read-only shadow of mhpmcounter25.
Zihpm depends on Zicsr and supplies up to 29 performance counters, while the platform determines whether this counter is implemented, its width, and its event.
In S/U mode, a clear mcounteren.HPM25 causes an illegal-instruction exception on read; when scounteren is implemented, its HPM25 bit controls U-mode access.

What To Check First When Reading This CSR

  • - Confirm that Zihpm (which depends on Zicsr) and this counter are implemented. Accessing an unimplemented counter may raise an illegal-instruction exception or return a constant value.
  • - In S/U mode, reading raises an illegal-instruction exception when mcounteren.HPM25 is clear; when scounteren is implemented, its HPM25 bit also controls U-mode access.
  • - A misconfigured event-selection configuration may cause the counter to return a constant value.
  • - With the Hypervisor extension and V=1, a clear hcounteren.HPM25 raises a virtual-instruction exception when mcounteren.HPM25 is set; VU-mode also requires the corresponding mcounteren, hcounteren, and scounteren bits to be set.

Risk Checks Before Writing

  • - hpmcounter25 is a read-only shadow of mhpmcounter25; do not write this user-level CSR.

Put It Back Into A Real Flow

1

Use the execution environment interface to confirm the implemented count, width, and event configuration.

2

Check the mcounteren/scounteren permission required at the current privilege level.

3

Read hpmcounter25; RV32 also needs hpmcounter25h to obtain the full 64-bit value.

FAQ

Is hpmcounter25 always readable?

No. An unimplemented counter may raise an illegal-instruction exception or return a constant value; S/U-mode access also requires mcounteren.HPM25, and U-mode access requires scounteren.HPM25 when scounteren is implemented.

How does RV32 read the full hpmcounter25?

This CSR reads the low 32 bits; hpmcounter25h reads the upper 32 bits of the same 64-bit counter.