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

CY

0

RW
RO
UNDEFINED_LEGAL
0

IR

2

RW
RO
UNDEFINED_LEGAL
0

HPM3

3

RW
RO
UNDEFINED_LEGAL
0

HPM4

4

RW
RO
UNDEFINED_LEGAL
0

HPM5

5

RW
RO
UNDEFINED_LEGAL
0

HPM6

6

RW
RO
UNDEFINED_LEGAL
0

HPM7

7

RW
RO
UNDEFINED_LEGAL
0

HPM8

8

RW
RO
UNDEFINED_LEGAL
0

HPM9

9

RW
RO
UNDEFINED_LEGAL
0

HPM10

10

RW
RO
UNDEFINED_LEGAL
0

HPM11

11

RW
RO
UNDEFINED_LEGAL
0

HPM12

12

RW
RO
UNDEFINED_LEGAL
0

HPM13

13

RW
RO
UNDEFINED_LEGAL
0

HPM14

14

RW
RO
UNDEFINED_LEGAL
0

HPM15

15

RW
RO
UNDEFINED_LEGAL
0

HPM16

16

RW
RO
UNDEFINED_LEGAL
0

HPM17

17

RW
RO
UNDEFINED_LEGAL
0

HPM18

18

RW
RO
UNDEFINED_LEGAL
0

HPM19

19

RW
RO
UNDEFINED_LEGAL
0

HPM20

20

RW
RO
UNDEFINED_LEGAL
0

HPM21

21

RW
RO
UNDEFINED_LEGAL
0

HPM22

22

RW
RO
UNDEFINED_LEGAL
0

HPM23

23

RW
RO
UNDEFINED_LEGAL
0

HPM24

24

RW
RO
UNDEFINED_LEGAL
0

HPM25

25

RW
RO
UNDEFINED_LEGAL
0

HPM26

26

RW
RO
UNDEFINED_LEGAL
0

HPM27

27

RW
RO
UNDEFINED_LEGAL
0

HPM28

28

RW
RO
UNDEFINED_LEGAL
0

HPM29

29

RW
RO
UNDEFINED_LEGAL
0

HPM30

30

RW
RO
UNDEFINED_LEGAL
0

HPM31

31

RW
RO
UNDEFINED_LEGAL
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="COUNTINHIBIT_EN[3] == true"]
When set, hpmcounter3.COUNT stops counting in all privilege modes.

[when="COUNTINHIBIT_EN[3] == false"]
Since hpmcounter3 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM4

Location

4

Description

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

[when="COUNTINHIBIT_EN[4] == false"]
Since hpmcounter4 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM5

Location

5

Description

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

[when="COUNTINHIBIT_EN[5] == false"]
Since hpmcounter5 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM6

Location

6

Description

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

[when="COUNTINHIBIT_EN[6] == false"]
Since hpmcounter6 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM7

Location

7

Description

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

[when="COUNTINHIBIT_EN[7] == false"]
Since hpmcounter7 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM8

Location

8

Description

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

[when="COUNTINHIBIT_EN[8] == false"]
Since hpmcounter8 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM9

Location

9

Description

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

[when="COUNTINHIBIT_EN[9] == false"]
Since hpmcounter9 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM10

Location

10

Description

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

[when="COUNTINHIBIT_EN[10] == false"]
Since hpmcounter10 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM11

Location

11

Description

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

[when="COUNTINHIBIT_EN[11] == false"]
Since hpmcounter11 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM12

Location

12

Description

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

[when="COUNTINHIBIT_EN[12] == false"]
Since hpmcounter12 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM13

Location

13

Description

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

[when="COUNTINHIBIT_EN[13] == false"]
Since hpmcounter13 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM14

Location

14

Description

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

[when="COUNTINHIBIT_EN[14] == false"]
Since hpmcounter14 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM15

Location

15

Description

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

[when="COUNTINHIBIT_EN[15] == false"]
Since hpmcounter15 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM16

Location

16

Description

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

[when="COUNTINHIBIT_EN[16] == false"]
Since hpmcounter16 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM17

Location

17

Description

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

[when="COUNTINHIBIT_EN[17] == false"]
Since hpmcounter17 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM18

Location

18

Description

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

[when="COUNTINHIBIT_EN[18] == false"]
Since hpmcounter18 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM19

Location

19

Description

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

[when="COUNTINHIBIT_EN[19] == false"]
Since hpmcounter19 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM20

Location

20

Description

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

[when="COUNTINHIBIT_EN[20] == false"]
Since hpmcounter20 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM21

Location

21

Description

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

[when="COUNTINHIBIT_EN[21] == false"]
Since hpmcounter21 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM22

Location

22

Description

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

[when="COUNTINHIBIT_EN[22] == false"]
Since hpmcounter22 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM23

Location

23

Description

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

[when="COUNTINHIBIT_EN[23] == false"]
Since hpmcounter23 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM24

Location

24

Description

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

[when="COUNTINHIBIT_EN[24] == false"]
Since hpmcounter24 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM25

Location

25

Description

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

[when="COUNTINHIBIT_EN[25] == false"]
Since hpmcounter25 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM26

Location

26

Description

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

[when="COUNTINHIBIT_EN[26] == false"]
Since hpmcounter26 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM27

Location

27

Description

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

[when="COUNTINHIBIT_EN[27] == false"]
Since hpmcounter27 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM28

Location

28

Description

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

[when="COUNTINHIBIT_EN[28] == false"]
Since hpmcounter28 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM29

Location

29

Description

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

[when="COUNTINHIBIT_EN[29] == false"]
Since hpmcounter29 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM30

Location

30

Description

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

[when="COUNTINHIBIT_EN[30] == false"]
Since hpmcounter30 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

HPM31

Location

31

Description

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

[when="COUNTINHIBIT_EN[31] == false"]
Since hpmcounter31 is not implemented, this field is read-only zero.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0