← Home

mcountinhibit

Machine Counter Inhibit

Address: 0x320 (800) · Privilege: M · Length: 32 · Writable · Defined by: Sm and MCOUNTINHIBIT_IMPLEMENTED == True

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.

Fields

31:2423:1615:87:0
HPM31HPM30HPM29HPM28HPM27HPM26HPM25HPM24HPM23HPM22HPM21HPM20HPM19HPM18HPM17HPM16HPM15HPM14HPM13HPM12HPM11HPM10HPM9HPM8HPM7HPM6HPM5HPM4HPM3IR—CY
BitsFieldAliasDescriptionTypeReset
[0]CYWhen set, `mcycle.COUNT` stops counting in all privilege modes.
return COUNTINHIBIT_EN[0] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[0] ? UNDEFINED_LEGAL : 0;
[2]IRWhen set, `minstret.COUNT` stops counting in all privilege modes.
return COUNTINHIBIT_EN[2] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[2] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[3] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[3] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[4] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[4] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[5] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[5] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[6] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[6] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[7] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[7] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[8] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[8] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[9] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[9] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[10] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[10] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[11] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[11] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[12] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[12] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[13] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[13] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[14] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[14] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[15] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[15] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[16] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[16] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[17] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[17] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[18] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[18] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[19] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[19] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[20] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[20] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[21] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[21] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[22] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[22] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[23] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[23] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[24] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[24] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[25] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[25] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[26] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[26] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[27] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[27] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[28] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[28] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[29] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[29] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[30] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[30] ? UNDEFINED_LEGAL : 0;
[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.
return COUNTINHIBIT_EN[31] ? CsrFieldType::RW : CsrFieldType::RO;
return COUNTINHIBIT_EN[31] ? UNDEFINED_LEGAL : 0;

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.