Webcentive RISC-V Reference

mcountinhibit

Machine counter-inhibit register

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

Privileged spec: Machine counter-inhibit register

Description

Bits to inhibit (stops counting) performance counters.

The counter-inhibit register mcountinhibit is a WARL register that controls which of the hardware performance-monitoring counters increment. The settings in this register only control whether the counters increment; their accessibility is not affected by the setting of this register.

When the CY, IR, or HPMn bit in the mcountinhibit register is clear, the mcycle, minstret, or mhpmcountern register increments as usual. When the CY, IR, or HPM_n_ bit is set, the corresponding counter does not increment.

The mcycle CSR may be shared between harts on the same core, in which case the mcountinhibit.CY field is also shared between those harts, and so writes to mcountinhibit.CY will be visible to those harts.

If the mcountinhibit register is not implemented, the implementation behaves as though the register were set to zero.

Note

When the mcycle and minstret counters are not needed, it is desirable to conditionally inhibit them to reduce energy consumption. Providing a single CSR to inhibit all counters also allows the counters to be atomically sampled.

Because the mtime counter can be shared between multiple cores, it cannot be inhibited with the mcountinhibit mechanism.

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
CY0

When set, mcycle.COUNT stops counting in all privilege modes.

IR2

When set, minstret.COUNT stops counting in all privilege modes.

HPM33

[when="COUNTINHIBIT_EN[3] == true"] When set, hpmcounter3.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[3] == false"] Since mcountinhibit.HPM3 is not writable, this field is read-only zero.

HPM44

[when="COUNTINHIBIT_EN[4] == true"] When set, hpmcounter4.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[4] == false"] Since mcountinhibit.HPM4 is not writable, this field is read-only zero.

HPM55

[when="COUNTINHIBIT_EN[5] == true"] When set, hpmcounter5.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[5] == false"] Since mcountinhibit.HPM5 is not writable, this field is read-only zero.

HPM66

[when="COUNTINHIBIT_EN[6] == true"] When set, hpmcounter6.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[6] == false"] Since mcountinhibit.HPM6 is not writable, this field is read-only zero.

HPM77

[when="COUNTINHIBIT_EN[7] == true"] When set, hpmcounter7.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[7] == false"] Since mcountinhibit.HPM7 is not writable, this field is read-only zero.

HPM88

[when="COUNTINHIBIT_EN[8] == true"] When set, hpmcounter8.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[8] == false"] Since mcountinhibit.HPM8 is not writable, this field is read-only zero.

HPM99

[when="COUNTINHIBIT_EN[9] == true"] When set, hpmcounter9.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[9] == false"] Since mcountinhibit.HPM9 is not writable, this field is read-only zero.

HPM1010

[when="COUNTINHIBIT_EN[10] == true"] When set, hpmcounter10.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[10] == false"] Since mcountinhibit.HPM10 is not writable, this field is read-only zero.

HPM1111

[when="COUNTINHIBIT_EN[11] == true"] When set, hpmcounter11.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[11] == false"] Since mcountinhibit.HPM11 is not writable, this field is read-only zero.

HPM1212

[when="COUNTINHIBIT_EN[12] == true"] When set, hpmcounter12.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[12] == false"] Since mcountinhibit.HPM12 is not writable, this field is read-only zero.

HPM1313

[when="COUNTINHIBIT_EN[13] == true"] When set, hpmcounter13.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[13] == false"] Since mcountinhibit.HPM13 is not writable, this field is read-only zero.

HPM1414

[when="COUNTINHIBIT_EN[14] == true"] When set, hpmcounter14.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[14] == false"] Since mcountinhibit.HPM14 is not writable, this field is read-only zero.

HPM1515

[when="COUNTINHIBIT_EN[15] == true"] When set, hpmcounter15.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[15] == false"] Since mcountinhibit.HPM15 is not writable, this field is read-only zero.

HPM1616

[when="COUNTINHIBIT_EN[16] == true"] When set, hpmcounter16.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[16] == false"] Since mcountinhibit.HPM16 is not writable, this field is read-only zero.

HPM1717

[when="COUNTINHIBIT_EN[17] == true"] When set, hpmcounter17.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[17] == false"] Since mcountinhibit.HPM17 is not writable, this field is read-only zero.

HPM1818

[when="COUNTINHIBIT_EN[18] == true"] When set, hpmcounter18.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[18] == false"] Since mcountinhibit.HPM18 is not writable, this field is read-only zero.

HPM1919

[when="COUNTINHIBIT_EN[19] == true"] When set, hpmcounter19.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[19] == false"] Since mcountinhibit.HPM19 is not writable, this field is read-only zero.

HPM2020

[when="COUNTINHIBIT_EN[20] == true"] When set, hpmcounter20.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[20] == false"] Since mcountinhibit.HPM20 is not writable, this field is read-only zero.

HPM2121

[when="COUNTINHIBIT_EN[21] == true"] When set, hpmcounter21.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[21] == false"] Since mcountinhibit.HPM21 is not writable, this field is read-only zero.

HPM2222

[when="COUNTINHIBIT_EN[22] == true"] When set, hpmcounter22.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[22] == false"] Since mcountinhibit.HPM22 is not writable, this field is read-only zero.

HPM2323

[when="COUNTINHIBIT_EN[23] == true"] When set, hpmcounter23.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[23] == false"] Since mcountinhibit.HPM23 is not writable, this field is read-only zero.

HPM2424

[when="COUNTINHIBIT_EN[24] == true"] When set, hpmcounter24.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[24] == false"] Since mcountinhibit.HPM24 is not writable, this field is read-only zero.

HPM2525

[when="COUNTINHIBIT_EN[25] == true"] When set, hpmcounter25.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[25] == false"] Since mcountinhibit.HPM25 is not writable, this field is read-only zero.

HPM2626

[when="COUNTINHIBIT_EN[26] == true"] When set, hpmcounter26.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[26] == false"] Since mcountinhibit.HPM26 is not writable, this field is read-only zero.

HPM2727

[when="COUNTINHIBIT_EN[27] == true"] When set, hpmcounter27.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[27] == false"] Since mcountinhibit.HPM27 is not writable, this field is read-only zero.

HPM2828

[when="COUNTINHIBIT_EN[28] == true"] When set, hpmcounter28.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[28] == false"] Since mcountinhibit.HPM28 is not writable, this field is read-only zero.

HPM2929

[when="COUNTINHIBIT_EN[29] == true"] When set, hpmcounter29.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[29] == false"] Since mcountinhibit.HPM29 is not writable, this field is read-only zero.

HPM3030

[when="COUNTINHIBIT_EN[30] == true"] When set, hpmcounter30.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[30] == false"] Since mcountinhibit.HPM30 is not writable, this field is read-only zero.

HPM3131

[when="COUNTINHIBIT_EN[31] == true"] When set, hpmcounter31.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[31] == false"] Since mcountinhibit.HPM31 is not writable, this field is read-only zero.

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

Specification and related pages