mcountinhibit
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
MSmSummary
Bits to inhibit (stops counting) performance counters.
Syntax / Encoding
CSR 0x320 (M-mode, RW)
Bitfields (31)
| Bits | Field | Description |
|---|---|---|
31 | HPM31 | [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. |
30 | HPM30 | [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. |
29 | HPM29 | [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. |
28 | HPM28 | [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. |
27 | HPM27 | [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. |
26 | HPM26 | [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. |
25 | HPM25 | [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. |
24 | HPM24 | [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. |
23 | HPM23 | [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. |
22 | HPM22 | [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. |
21 | HPM21 | [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. |
20 | HPM20 | [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. |
19 | HPM19 | [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. |
18 | HPM18 | [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. |
17 | HPM17 | [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. |
16 | HPM16 | [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. |
15 | HPM15 | [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. |
14 | HPM14 | [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. |
13 | HPM13 | [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. |
12 | HPM12 | [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. |
11 | HPM11 | [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. |
10 | HPM10 | [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. |
9 | HPM9 | [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. |
8 | HPM8 | [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. |
7 | HPM7 | [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. |
6 | HPM6 | [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. |
5 | HPM5 | [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. |
4 | HPM4 | [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. |
3 | HPM3 | [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. |
2 | IR | When set, minstret.COUNT stops counting in all privilege modes. |
0 | CY | When set, mcycle.COUNT stops counting in all privilege modes. |
Reference Notes
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 HPM__n__ 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. ====