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

CSR Address

0x320

Defining extension

(Sm && MCOUNTINHIBIT_IMPLEMENTED == true)

Length

32-bit

Privilege Mode

M

Format

mcountinhibit format
Figure 1. mcountinhibit format

Field Summary

Name Location Type Reset Value

CY

0

RW

UNDEFINED_LEGAL

IR

2

RW

UNDEFINED_LEGAL

HPM3

3

RW

UNDEFINED_LEGAL

HPM4

4

RW

UNDEFINED_LEGAL

HPM5

5

RW

UNDEFINED_LEGAL

HPM6

6

RW

UNDEFINED_LEGAL

HPM7

7

RW

UNDEFINED_LEGAL

HPM8

8

RW

UNDEFINED_LEGAL

HPM9

9

RW

UNDEFINED_LEGAL

HPM10

10

RW

UNDEFINED_LEGAL

HPM11

11

RO

0

HPM12

12

RO

0

HPM13

13

RO

0

HPM14

14

RO

0

HPM15

15

RO

0

HPM16

16

RO

0

HPM17

17

RO

0

HPM18

18

RO

0

HPM19

19

RO

0

HPM20

20

RO

0

HPM21

21

RO

0

HPM22

22

RO

0

HPM23

23

RO

0

HPM24

24

RO

0

HPM25

25

RO

0

HPM26

26

RO

0

HPM27

27

RO

0

HPM28

28

RO

0

HPM29

29

RO

0

HPM30

30

RO

0

HPM31

31

RO

0

Fields

CY

Location

mcountinhibit[0]

Description

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

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

IR

Location

mcountinhibit[2]

Description

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

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM3

Location

mcountinhibit[3]

Description

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

+

Since mcountinhibit.HPM3 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM4

Location

mcountinhibit[4]

Description

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

+

Since mcountinhibit.HPM4 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM5

Location

mcountinhibit[5]

Description

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

+

Since mcountinhibit.HPM5 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM6

Location

mcountinhibit[6]

Description

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

+

Since mcountinhibit.HPM6 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM7

Location

mcountinhibit[7]

Description

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

+

Since mcountinhibit.HPM7 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM8

Location

mcountinhibit[8]

Description

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

+

Since mcountinhibit.HPM8 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM9

Location

mcountinhibit[9]

Description

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

+

Since mcountinhibit.HPM9 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM10

Location

mcountinhibit[10]

Description

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

+

Since mcountinhibit.HPM10 is not writable, this field is read-only zero.

Type

RW

Read-Write

Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads.

Reset value

UNDEFINED_LEGAL

HPM11

Location

mcountinhibit[11]

Description

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

+

Since mcountinhibit.HPM11 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM12

Location

mcountinhibit[12]

Description

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

+

Since mcountinhibit.HPM12 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM13

Location

mcountinhibit[13]

Description

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

+

Since mcountinhibit.HPM13 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM14

Location

mcountinhibit[14]

Description

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

+

Since mcountinhibit.HPM14 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM15

Location

mcountinhibit[15]

Description

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

+

Since mcountinhibit.HPM15 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM16

Location

mcountinhibit[16]

Description

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

+

Since mcountinhibit.HPM16 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM17

Location

mcountinhibit[17]

Description

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

+

Since mcountinhibit.HPM17 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM18

Location

mcountinhibit[18]

Description

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

+

Since mcountinhibit.HPM18 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM19

Location

mcountinhibit[19]

Description

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

+

Since mcountinhibit.HPM19 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM20

Location

mcountinhibit[20]

Description

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

+

Since mcountinhibit.HPM20 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM21

Location

mcountinhibit[21]

Description

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

+

Since mcountinhibit.HPM21 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM22

Location

mcountinhibit[22]

Description

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

+

Since mcountinhibit.HPM22 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM23

Location

mcountinhibit[23]

Description

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

+

Since mcountinhibit.HPM23 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM24

Location

mcountinhibit[24]

Description

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

+

Since mcountinhibit.HPM24 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM25

Location

mcountinhibit[25]

Description

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

+

Since mcountinhibit.HPM25 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM26

Location

mcountinhibit[26]

Description

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

+

Since mcountinhibit.HPM26 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM27

Location

mcountinhibit[27]

Description

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

+

Since mcountinhibit.HPM27 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM28

Location

mcountinhibit[28]

Description

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

+

Since mcountinhibit.HPM28 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM29

Location

mcountinhibit[29]

Description

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

+

Since mcountinhibit.HPM29 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM30

Location

mcountinhibit[30]

Description

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

+

Since mcountinhibit.HPM30 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

HPM31

Location

mcountinhibit[31]

Description

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

+

Since mcountinhibit.HPM31 is not writable, this field is read-only zero.

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0