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 >= Sm@1.11.0

    • Smhpm, version >= Smhpm@1.11.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

UNDEFINED_LEGAL

mcountinhibit.IR

2

UNDEFINED_LEGAL

mcountinhibit.HPM3

3

UNDEFINED_LEGAL

mcountinhibit.HPM4

4

UNDEFINED_LEGAL

mcountinhibit.HPM5

5

UNDEFINED_LEGAL

mcountinhibit.HPM6

6

UNDEFINED_LEGAL

mcountinhibit.HPM7

7

UNDEFINED_LEGAL

mcountinhibit.HPM8

8

UNDEFINED_LEGAL

mcountinhibit.HPM9

9

UNDEFINED_LEGAL

mcountinhibit.HPM10

10

UNDEFINED_LEGAL

mcountinhibit.HPM11

11

UNDEFINED_LEGAL

mcountinhibit.HPM12

12

UNDEFINED_LEGAL

mcountinhibit.HPM13

13

UNDEFINED_LEGAL

mcountinhibit.HPM14

14

UNDEFINED_LEGAL

mcountinhibit.HPM15

15

UNDEFINED_LEGAL

mcountinhibit.HPM16

16

UNDEFINED_LEGAL

mcountinhibit.HPM17

17

UNDEFINED_LEGAL

mcountinhibit.HPM18

18

UNDEFINED_LEGAL

mcountinhibit.HPM19

19

UNDEFINED_LEGAL

mcountinhibit.HPM20

20

UNDEFINED_LEGAL

mcountinhibit.HPM21

21

UNDEFINED_LEGAL

mcountinhibit.HPM22

22

UNDEFINED_LEGAL

mcountinhibit.HPM23

23

UNDEFINED_LEGAL

mcountinhibit.HPM24

24

UNDEFINED_LEGAL

mcountinhibit.HPM25

25

UNDEFINED_LEGAL

mcountinhibit.HPM26

26

UNDEFINED_LEGAL

mcountinhibit.HPM27

27

UNDEFINED_LEGAL

mcountinhibit.HPM28

28

UNDEFINED_LEGAL

mcountinhibit.HPM29

29

UNDEFINED_LEGAL

mcountinhibit.HPM30

30

UNDEFINED_LEGAL

mcountinhibit.HPM31

31

UNDEFINED_LEGAL

Fields

CY

Location

0

Description

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

Type
Reset value

UNDEFINED_LEGAL

IR

Location

2

Description

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

Type
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL

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
Reset value

UNDEFINED_LEGAL