mcountinhibit

Machine Counter Inhibit

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.

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.

Attributes

Defining Extension

  • anyOf:

    • Sm, version >= 0

    • Smhpm, version >= 0

CSR Address

0x320

Length

32-bit

Privilege Mode

M

Format

mcountinhibit format
Figure 1. mcountinhibit format

Field Summary

Name Location Type Reset Value

mcountinhibit.CY

0

[when,"COUNTINHIBIT_EN[0]"] RW

[when,"!(COUNTINHIBIT_EN[0])"] RO

[when,"COUNTINHIBIT_EN[0]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[0])"] 0

mcountinhibit.IR

2

[when,"COUNTINHIBIT_EN[2]"] RW

[when,"!(COUNTINHIBIT_EN[2])"] RO

[when,"COUNTINHIBIT_EN[2]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[2])"] 0

mcountinhibit.HPM3

3

[when,"COUNTINHIBIT_EN[3]"] RW

[when,"!(COUNTINHIBIT_EN[3])"] RO

[when,"COUNTINHIBIT_EN[3]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[3])"] 0

mcountinhibit.HPM4

4

[when,"COUNTINHIBIT_EN[4]"] RW

[when,"!(COUNTINHIBIT_EN[4])"] RO

[when,"COUNTINHIBIT_EN[4]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[4])"] 0

mcountinhibit.HPM5

5

[when,"COUNTINHIBIT_EN[5]"] RW

[when,"!(COUNTINHIBIT_EN[5])"] RO

[when,"COUNTINHIBIT_EN[5]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[5])"] 0

mcountinhibit.HPM6

6

[when,"COUNTINHIBIT_EN[6]"] RW

[when,"!(COUNTINHIBIT_EN[6])"] RO

[when,"COUNTINHIBIT_EN[6]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[6])"] 0

mcountinhibit.HPM7

7

[when,"COUNTINHIBIT_EN[7]"] RW

[when,"!(COUNTINHIBIT_EN[7])"] RO

[when,"COUNTINHIBIT_EN[7]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[7])"] 0

mcountinhibit.HPM8

8

[when,"COUNTINHIBIT_EN[8]"] RW

[when,"!(COUNTINHIBIT_EN[8])"] RO

[when,"COUNTINHIBIT_EN[8]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[8])"] 0

mcountinhibit.HPM9

9

[when,"COUNTINHIBIT_EN[9]"] RW

[when,"!(COUNTINHIBIT_EN[9])"] RO

[when,"COUNTINHIBIT_EN[9]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[9])"] 0

mcountinhibit.HPM10

10

[when,"COUNTINHIBIT_EN[10]"] RW

[when,"!(COUNTINHIBIT_EN[10])"] RO

[when,"COUNTINHIBIT_EN[10]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[10])"] 0

mcountinhibit.HPM11

11

[when,"COUNTINHIBIT_EN[11]"] RW

[when,"!(COUNTINHIBIT_EN[11])"] RO

[when,"COUNTINHIBIT_EN[11]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[11])"] 0

mcountinhibit.HPM12

12

[when,"COUNTINHIBIT_EN[12]"] RW

[when,"!(COUNTINHIBIT_EN[12])"] RO

[when,"COUNTINHIBIT_EN[12]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[12])"] 0

mcountinhibit.HPM13

13

[when,"COUNTINHIBIT_EN[13]"] RW

[when,"!(COUNTINHIBIT_EN[13])"] RO

[when,"COUNTINHIBIT_EN[13]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[13])"] 0

mcountinhibit.HPM14

14

[when,"COUNTINHIBIT_EN[14]"] RW

[when,"!(COUNTINHIBIT_EN[14])"] RO

[when,"COUNTINHIBIT_EN[14]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[14])"] 0

mcountinhibit.HPM15

15

[when,"COUNTINHIBIT_EN[15]"] RW

[when,"!(COUNTINHIBIT_EN[15])"] RO

[when,"COUNTINHIBIT_EN[15]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[15])"] 0

mcountinhibit.HPM16

16

[when,"COUNTINHIBIT_EN[16]"] RW

[when,"!(COUNTINHIBIT_EN[16])"] RO

[when,"COUNTINHIBIT_EN[16]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[16])"] 0

mcountinhibit.HPM17

17

[when,"COUNTINHIBIT_EN[17]"] RW

[when,"!(COUNTINHIBIT_EN[17])"] RO

[when,"COUNTINHIBIT_EN[17]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[17])"] 0

mcountinhibit.HPM18

18

[when,"COUNTINHIBIT_EN[18]"] RW

[when,"!(COUNTINHIBIT_EN[18])"] RO

[when,"COUNTINHIBIT_EN[18]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[18])"] 0

mcountinhibit.HPM19

19

[when,"COUNTINHIBIT_EN[19]"] RW

[when,"!(COUNTINHIBIT_EN[19])"] RO

[when,"COUNTINHIBIT_EN[19]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[19])"] 0

mcountinhibit.HPM20

20

[when,"COUNTINHIBIT_EN[20]"] RW

[when,"!(COUNTINHIBIT_EN[20])"] RO

[when,"COUNTINHIBIT_EN[20]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[20])"] 0

mcountinhibit.HPM21

21

[when,"COUNTINHIBIT_EN[21]"] RW

[when,"!(COUNTINHIBIT_EN[21])"] RO

[when,"COUNTINHIBIT_EN[21]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[21])"] 0

mcountinhibit.HPM22

22

[when,"COUNTINHIBIT_EN[22]"] RW

[when,"!(COUNTINHIBIT_EN[22])"] RO

[when,"COUNTINHIBIT_EN[22]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[22])"] 0

mcountinhibit.HPM23

23

[when,"COUNTINHIBIT_EN[23]"] RW

[when,"!(COUNTINHIBIT_EN[23])"] RO

[when,"COUNTINHIBIT_EN[23]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[23])"] 0

mcountinhibit.HPM24

24

[when,"COUNTINHIBIT_EN[24]"] RW

[when,"!(COUNTINHIBIT_EN[24])"] RO

[when,"COUNTINHIBIT_EN[24]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[24])"] 0

mcountinhibit.HPM25

25

[when,"COUNTINHIBIT_EN[25]"] RW

[when,"!(COUNTINHIBIT_EN[25])"] RO

[when,"COUNTINHIBIT_EN[25]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[25])"] 0

mcountinhibit.HPM26

26

[when,"COUNTINHIBIT_EN[26]"] RW

[when,"!(COUNTINHIBIT_EN[26])"] RO

[when,"COUNTINHIBIT_EN[26]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[26])"] 0

mcountinhibit.HPM27

27

[when,"COUNTINHIBIT_EN[27]"] RW

[when,"!(COUNTINHIBIT_EN[27])"] RO

[when,"COUNTINHIBIT_EN[27]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[27])"] 0

mcountinhibit.HPM28

28

[when,"COUNTINHIBIT_EN[28]"] RW

[when,"!(COUNTINHIBIT_EN[28])"] RO

[when,"COUNTINHIBIT_EN[28]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[28])"] 0

mcountinhibit.HPM29

29

[when,"COUNTINHIBIT_EN[29]"] RW

[when,"!(COUNTINHIBIT_EN[29])"] RO

[when,"COUNTINHIBIT_EN[29]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[29])"] 0

mcountinhibit.HPM30

30

[when,"COUNTINHIBIT_EN[30]"] RW

[when,"!(COUNTINHIBIT_EN[30])"] RO

[when,"COUNTINHIBIT_EN[30]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[30])"] 0

mcountinhibit.HPM31

31

[when,"COUNTINHIBIT_EN[31]"] RW

[when,"!(COUNTINHIBIT_EN[31])"] RO

[when,"COUNTINHIBIT_EN[31]"] UNDEFINED_LEGAL

[when,"!(COUNTINHIBIT_EN[31])"] 0

Fields

CY

Location

0

Description

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

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

IR

Location

2

Description

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

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM3

Location

3

Description

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

Since hpmcounter3 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM4

Location

4

Description

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

Since hpmcounter4 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM5

Location

5

Description

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

Since hpmcounter5 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM6

Location

6

Description

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

Since hpmcounter6 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM7

Location

7

Description

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

Since hpmcounter7 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM8

Location

8

Description

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

Since hpmcounter8 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM9

Location

9

Description

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

Since hpmcounter9 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM10

Location

10

Description

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

Since hpmcounter10 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM11

Location

11

Description

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

Since hpmcounter11 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM12

Location

12

Description

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

Since hpmcounter12 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM13

Location

13

Description

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

Since hpmcounter13 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM14

Location

14

Description

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

Since hpmcounter14 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM15

Location

15

Description

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

Since hpmcounter15 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM16

Location

16

Description

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

Since hpmcounter16 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM17

Location

17

Description

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

Since hpmcounter17 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM18

Location

18

Description

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

Since hpmcounter18 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM19

Location

19

Description

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

Since hpmcounter19 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM20

Location

20

Description

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

Since hpmcounter20 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM21

Location

21

Description

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

Since hpmcounter21 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM22

Location

22

Description

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

Since hpmcounter22 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM23

Location

23

Description

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

Since hpmcounter23 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM24

Location

24

Description

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

Since hpmcounter24 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM25

Location

25

Description

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

Since hpmcounter25 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM26

Location

26

Description

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

Since hpmcounter26 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM27

Location

27

Description

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

Since hpmcounter27 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM28

Location

28

Description

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

Since hpmcounter28 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM29

Location

29

Description

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

Since hpmcounter29 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM30

Location

30

Description

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

Since hpmcounter30 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM31

Location

31

Description

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

Since hpmcounter31 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0