mcyclecfg

Machine Cycle Counter Configuration

The mcyclecfg CSR is a 64-bit machine-level register that configures privilege mode filtering for the cycle counter. Each inhibit bit (xINH) suppresses counting of events in the corresponding privilege mode when set.

| Field | Description | |---------|---------------------------------------------------------| | MINH | If set, then counting of events in M-mode is inhibited. | | SINH | If set, then counting of events in S/HS-mode is inhibited. | | UINH | If set, then counting of events in U-mode is inhibited. | | VSINH | If set, then counting of events in VS-mode is inhibited. | | VUINH | If set, then counting of events in VU-mode is inhibited. |

When all xINH bits are zero, event counting is enabled in all modes.

For each bit in 61:58, if the associated privilege mode is not implemented, the bit is read-only zero.

Bit 63 is hardwired to 0, as these counters do not generate overflow interrupts.

Bits [57:0] are reserved (WPRI) and read as zero.

For RV32, the upper 32 bits of mcyclecfg are accessed via mcyclecfgh (CSR 0x721).

Note: Although CSR address 0x320 would have been a more natural choice, it is already allocated to mcountinhibit.

Attributes

Defining Extension

  • Smcntrpmf, version >= Smcntrpmf@1.0.0

CSR Address

0x321

Length

64-bit

Privilege Mode

M

Format

mcyclecfg format
Figure 1. mcyclecfg format

Field Summary

Name Location Type Reset Value

mcyclecfg.MINH

62

RW

UNDEFINED_LEGAL

mcyclecfg.SINH

61

RW

UNDEFINED_LEGAL

mcyclecfg.UINH

60

RW

UNDEFINED_LEGAL

mcyclecfg.VSINH

59

RW

UNDEFINED_LEGAL

mcyclecfg.VUINH

58

RW

UNDEFINED_LEGAL

Fields

MINH

Location

62

Description

If set, then counting of events in M-mode is inhibited.

Type

RW

Reset value

UNDEFINED_LEGAL

SINH

Location

61

Description

If set, then counting of events in S/HS-mode is inhibited.

Type

RW

Reset value

UNDEFINED_LEGAL

UINH

Location

60

Description

If set, then counting of events in U-mode is inhibited.

Type

RW

Reset value

UNDEFINED_LEGAL

VSINH

Location

59

Description

If set, then counting of events in VS-mode is inhibited.

Type

RW

Reset value

UNDEFINED_LEGAL

VUINH

Location

58

Description

If set, then counting of events in VU-mode is inhibited.

Type

RW

Reset value

UNDEFINED_LEGAL