CSR Bit Fields

RISC-V hpmcounter14 CSR Register

Address 0xC0EPrivilege UserAccess RO / XLEN (upper 32 bits in hpmcounter14h on RV32)User counters and performance-monitoring CSRs

hpmcounter14 is a Zihpm unprivileged hardware performance-counter CSR. When implemented and accessible, it provides the count for a platform-selected performance event.

Field Map

Understand hpmcounter14 By Bit Fields

1 key fields
XLEN-1:0

VALUE

RO

The readable XLEN-bit view of the corresponding performance counter. On RV32 this CSR reads the low 32 bits and hpmcounter14h reads bits 63-32; the implemented counter count, width, and counted events are platform-specific.

VALUE (bits XLEN-1:0) — The readable XLEN-bit view of the corresponding performance counter. On RV32 this CSR reads the low 32 bits and hpmcounter14h reads bits 63-32; the implemented counter count, width, and counted events are platform-specific.

What This Field Controls

  • - The readable XLEN-bit view of the corresponding performance counter. On RV32 this CSR reads the low 32 bits and hpmcounter14h reads bits 63-32; the implemented counter count, width, and counted 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

hpmcounter14 is a read-only Zihpm user performance counter. Its event and implemented width are platform-specific, and user access can be limited by counter-enable CSRs.

hpmcounter14 is the standard user-level read-only CSR at 0xC0E.
Zihpm depends on Zicsr and provides up to 29 additional unprivileged 64-bit performance counters.
On RV32, hpmcounter14 reads the low 32 bits and hpmcounter14h reads the upper 32 bits.
An unimplemented counter may trap or return a constant; the counted event and counter count and width are platform-specific.

What To Check First When Reading This CSR

  • - Zihpm depends on Zicsr; hpmcounter14 is one of up to 29 unprivileged hardware performance counters.
  • - On privileged platforms, lower-privilege access can be controlled by counter-enable CSRs; disabled access causes an illegal-instruction exception.
  • - An unimplemented counter may raise an illegal-instruction exception or return a constant value; a misconfigured event selection may also make the counter return a constant value.

Risk Checks Before Writing

  • - hpmcounter14 is read-only; an attempt to write a read-only CSR raises an illegal-instruction exception.

Put It Back Into A Real Flow

1

Confirm Zihpm, counter implementation, and access permission.

2

Read hpmcounter14; on RV32 also read hpmcounter14h when a full 64-bit value is needed.

3

On privileged RISC-V platforms, interpret the result for the event selected by the corresponding mhpmevent14; other execution environments may provide alternative event-configuration mechanisms.

FAQ

Is hpmcounter14 always implemented and readable?

No. The implemented counter count is platform-specific; accessing an unimplemented counter may raise an illegal-instruction exception or return a constant. On privileged platforms, counter-enable CSRs can also prohibit lower-privilege access.

How are the upper 32 bits of hpmcounter14 read on RV32?

Use hpmcounter14h: hpmcounter14 reads the low 32 bits and hpmcounter14h reads bits 63-32 of the same counter.