Webcentive RISC-V Reference

mhpmcounter14

Machine performance-monitoring counter

Address
0xB0E
Group
Machine-level CSRs
Privilege
MRW (privileged spec CSR listing, Machine Counter/Timers)
Access
read/write; lowest privilege M (machine)
Address range
Standard read/write
Name in riscv-unified-db
Machine Hardware Performance Counter 14

Privileged spec: Machine performance-monitoring counter

Description

Programmable hardware performance counter.

The hpmcounter14 CSR is a read-only shadow of this CSR. Access to hpmcounter14 is controlled with mcounteren.HPM14

When S is implemented:

, scounteren.HPM14

When H is implemented:

, and hcounteren.HPM14

as follows:

When H is implemented:

mcounteren.HPM14scounteren.HPM14hcounteren.HPM14
hpmcounter14 behavior
S-modeU-modeVS-modeVU-mode
0--IllegalInstructionIllegalInstructionIllegalInstructionIllegalInstruction
100read-onlyIllegalInstructionVirtualInstructionVirtualInstruction
110read-onlyread-onlyVirtualInstructionVirtualInstruction
101read-onlyIllegalInstructionread-onlyVirtualInstruction
111read-onlyread-onlyread-onlyread-only

Otherwise, when S is implemented:

mcounteren.HPM14scounteren.HPM14
hpmcounter14 behavior
S-modeU-mode
0-IllegalInstructionIllegalInstruction
10read-onlyIllegalInstruction
11read-onlyread-only

Otherwise:

mcounteren.HPM14
hpmcounter14 behavior
U-mode
0IllegalInstruction
1read-only

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
COUNT63-0

[when="HPM_COUNTER_EN[14] == true"] -- Performance counter for event selected in mhpmevent14.EVENT.

Increments every time event occurs unless:

  • mcountinhibit.HPM14 (when Smcdeleg is implemented: or its alias scountinhibit.HPM14) is set

When Sscofpmf is implemented:

  • mhpmevent14.MINH is set and the current privilege level is M

When S is implemented:

  • mhpmevent14.SINH (when Ssccfg is implemented: or its alias hpmevent14.SINH) is set and the current privilege level is (H)S

When U is implemented:

  • mhpmevent14.UINH (when Ssccfg is implemented: or its alias hpmevent14.UINH) is set and the current privilege level is U

When H is implemented:

  • mhpmevent14.VSINH (when Ssccfg is implemented: or its alias hpmevent14.VSINH) is set and the current privilege level is VS
  • mhpmevent14.VUINH (when Ssccfg is implemented: or its alias hpmevent14.VUINH) is set and the current privilege level is VU

[when="HPM_COUNTER_EN[14] == false"] Unimplemented performance counter. Must be read-only 0 (access does not cause trap).

Fields from riscv-unified-db; field types computed by IDL functions there are not shown.

Specification and related pages