ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

mcountinhibit

T1 riscv register register
Machine Counter Inhibit
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (Sm)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeM
ExtensionsSm

Summary

Bits to inhibit (stops counting) performance counters.

Syntax / Encoding

CSR 0x320 (M-mode, RW)

Bitfields (31)

BitsFieldDescription
31HPM31[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.
30HPM30[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.
29HPM29[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.
28HPM28[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.
27HPM27[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.
26HPM26[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.
25HPM25[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.
24HPM24[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.
23HPM23[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.
22HPM22[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.
21HPM21[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.
20HPM20[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.
19HPM19[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.
18HPM18[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.
17HPM17[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.
16HPM16[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.
15HPM15[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.
14HPM14[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.
13HPM13[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.
12HPM12[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.
11HPM11[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.
10HPM10[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.
9HPM9[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.
8HPM8[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.
7HPM7[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.
6HPM6[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.
5HPM5[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.
4HPM4[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.
3HPM3[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.
2IRWhen set, minstret.COUNT stops counting in all privilege modes.
0CYWhen 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.
====