mcounteren

Machine Counter Enable

The counter-enable mcounteren register is a 32-bit register that controls the availability of the hardware performance-monitoring counters to <%- if ext?(:S) -%> S-mode <%- elsif ext?(:U) -%> U-mode <%- else -%> the next-lower privileged mode <%- end -%> .

The settings in this register only control accessibility. The act of reading or writing this register does not affect the underlying counters, which continue to increment even when not accessible.

When the CY, TM, IR, or HPMn bit in the mcounteren register is clear, attempts to read the cycle, time, instret, or hpmcountern register while executing in <%- if ext?(:S) -%> S-mode <%- elsif ext?(:U) -%> U-mode <%- else -%> S-mode or U-mode <%- end -%> will cause an IllegalInstruction exception. When one of these bits is set, access to the corresponding register is permitted in <%- if ext?(:S) -%> S-mode <%- elsif ext?(:U) -%> U-mode <%- else -%> the next implemented privilege mode (S-mode if implemented, otherwise U-mode). <%- end -%>

The counter-enable bits support two common use cases with minimal hardware. For harts that do not need high-performance timers and counters, machine-mode software can trap accesses and implement all features in software. For harts that need high-performance timers and counters but are not concerned with obfuscating the underlying hardware counters, the counters can be directly exposed to lower privilege modes.

The cycle, instret, and hpmcountern CSRs are read-only shadows of mcycle, minstret, and mhpmcounter n, respectively. The time CSR is a read-only shadow of the memory-mapped mtime register. <%- if possible_xlens.include?(32) -%> Analogously, on RV32I the cycleh, instreth and hpmcounternh CSRs are read-only shadows of mcycleh, minstreth and mhpmcounternh, respectively. On RV32I the timeh CSR is a read-only shadow of the upper 32 bits of the memory-mapped mtime register, while time shadows only the lower 32 bits of mtime. <%- end -%>

Implementations can convert reads of the time and timeh CSRs into loads to the memory-mapped mtime register, or emulate this functionality on behalf of less-privileged modes in M-mode software.

<%- if !ext?(:U) -%> In harts with U-mode, the mcounteren CSR must be implemented, but all fields are WARL and may be read-only zero, indicating reads to the corresponding counter will cause an IllegalInstruction exception when executing in a less-privileged mode. In harts without U-mode, the mcounteren register should not exist. <%- end -%>

<%- if ext?(:S) -%>

The cycle, instret, and hpmcountern CSRs can also be made available to U-mode through the scounteren CSR <%- if ext?(:H) -%> and to VS-mode and/or VU-mode through hcounteren <%- end -%> . <%- end -%>

Attributes

Requirement

U

Defining extensions

U

User-mode privilege level

CSR Address

0x306

Length

32-bit

Privilege Mode

M

Format

mcounteren format
Figure 1. mcounteren format

Field Summary

Name Location Type Reset Value

mcounteren.CY

0

[when,"MCOUNTENABLE_EN[0]"] RW [when,"!(MCOUNTENABLE_EN[0])"] RO

UNDEFINED_LEGAL

mcounteren.TM

1

RO

0

mcounteren.IR

2

[when,"MCOUNTENABLE_EN[2]"] RW [when,"!(MCOUNTENABLE_EN[2])"] RO

UNDEFINED_LEGAL

mcounteren.HPM3

3

[when,"MCOUNTENABLE_EN[3]"] RW [when,"!(MCOUNTENABLE_EN[3])"] RO

UNDEFINED_LEGAL

mcounteren.HPM4

4

[when,"MCOUNTENABLE_EN[4]"] RW [when,"!(MCOUNTENABLE_EN[4])"] RO

UNDEFINED_LEGAL

mcounteren.HPM5

5

[when,"MCOUNTENABLE_EN[5]"] RW [when,"!(MCOUNTENABLE_EN[5])"] RO

UNDEFINED_LEGAL

mcounteren.HPM6

6

[when,"MCOUNTENABLE_EN[6]"] RW [when,"!(MCOUNTENABLE_EN[6])"] RO

UNDEFINED_LEGAL

mcounteren.HPM7

7

[when,"MCOUNTENABLE_EN[7]"] RW [when,"!(MCOUNTENABLE_EN[7])"] RO

UNDEFINED_LEGAL

mcounteren.HPM8

8

[when,"MCOUNTENABLE_EN[8]"] RW [when,"!(MCOUNTENABLE_EN[8])"] RO

UNDEFINED_LEGAL

mcounteren.HPM9

9

[when,"MCOUNTENABLE_EN[9]"] RW [when,"!(MCOUNTENABLE_EN[9])"] RO

UNDEFINED_LEGAL

mcounteren.HPM10

10

[when,"MCOUNTENABLE_EN[10]"] RW [when,"!(MCOUNTENABLE_EN[10])"] RO

UNDEFINED_LEGAL

mcounteren.HPM11

11

[when,"MCOUNTENABLE_EN[11]"] RW [when,"!(MCOUNTENABLE_EN[11])"] RO

UNDEFINED_LEGAL

mcounteren.HPM12

12

[when,"MCOUNTENABLE_EN[12]"] RW [when,"!(MCOUNTENABLE_EN[12])"] RO

UNDEFINED_LEGAL

mcounteren.HPM13

13

[when,"MCOUNTENABLE_EN[13]"] RW [when,"!(MCOUNTENABLE_EN[13])"] RO

UNDEFINED_LEGAL

mcounteren.HPM14

14

[when,"MCOUNTENABLE_EN[14]"] RW [when,"!(MCOUNTENABLE_EN[14])"] RO

UNDEFINED_LEGAL

mcounteren.HPM15

15

[when,"MCOUNTENABLE_EN[15]"] RW [when,"!(MCOUNTENABLE_EN[15])"] RO

UNDEFINED_LEGAL

mcounteren.HPM16

16

[when,"MCOUNTENABLE_EN[16]"] RW [when,"!(MCOUNTENABLE_EN[16])"] RO

UNDEFINED_LEGAL

mcounteren.HPM17

17

[when,"MCOUNTENABLE_EN[17]"] RW [when,"!(MCOUNTENABLE_EN[17])"] RO

UNDEFINED_LEGAL

mcounteren.HPM18

18

[when,"MCOUNTENABLE_EN[18]"] RW [when,"!(MCOUNTENABLE_EN[18])"] RO

UNDEFINED_LEGAL

mcounteren.HPM19

19

[when,"MCOUNTENABLE_EN[19]"] RW [when,"!(MCOUNTENABLE_EN[19])"] RO

UNDEFINED_LEGAL

mcounteren.HPM20

20

[when,"MCOUNTENABLE_EN[20]"] RW [when,"!(MCOUNTENABLE_EN[20])"] RO

UNDEFINED_LEGAL

mcounteren.HPM21

21

[when,"MCOUNTENABLE_EN[21]"] RW [when,"!(MCOUNTENABLE_EN[21])"] RO

UNDEFINED_LEGAL

mcounteren.HPM22

22

[when,"MCOUNTENABLE_EN[22]"] RW [when,"!(MCOUNTENABLE_EN[22])"] RO

UNDEFINED_LEGAL

mcounteren.HPM23

23

[when,"MCOUNTENABLE_EN[23]"] RW [when,"!(MCOUNTENABLE_EN[23])"] RO

UNDEFINED_LEGAL

mcounteren.HPM24

24

[when,"MCOUNTENABLE_EN[24]"] RW [when,"!(MCOUNTENABLE_EN[24])"] RO

UNDEFINED_LEGAL

mcounteren.HPM25

25

[when,"MCOUNTENABLE_EN[25]"] RW [when,"!(MCOUNTENABLE_EN[25])"] RO

UNDEFINED_LEGAL

mcounteren.HPM26

26

[when,"MCOUNTENABLE_EN[26]"] RW [when,"!(MCOUNTENABLE_EN[26])"] RO

UNDEFINED_LEGAL

mcounteren.HPM27

27

[when,"MCOUNTENABLE_EN[27]"] RW [when,"!(MCOUNTENABLE_EN[27])"] RO

UNDEFINED_LEGAL

mcounteren.HPM28

28

[when,"MCOUNTENABLE_EN[28]"] RW [when,"!(MCOUNTENABLE_EN[28])"] RO

UNDEFINED_LEGAL

mcounteren.HPM29

29

[when,"MCOUNTENABLE_EN[29]"] RW [when,"!(MCOUNTENABLE_EN[29])"] RO

UNDEFINED_LEGAL

mcounteren.HPM30

30

[when,"MCOUNTENABLE_EN[30]"] RW [when,"!(MCOUNTENABLE_EN[30])"] RO

UNDEFINED_LEGAL

mcounteren.HPM31

31

[when,"MCOUNTENABLE_EN[31]"] RW [when,"!(MCOUNTENABLE_EN[31])"] RO

UNDEFINED_LEGAL

Fields

CY

Location

0

Description

When set, the cycle CSR (an alias of mcycle) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.CY is also set, cycle is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.CY is also set, cycle is further accessible to VS-mode.

When hcounteren.CY && scounteren.CY are both set, cycle is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

TM

Location

1

Description

Placeholder for delegating time to less-privileged modes; however, since time is memory-mapped rather than a CSR, this field is always read-only zero.

Type

RO

Reset value

0

IR

Location

2

Description

When set, the instret CSR (an alias of minstret) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.IR is also set, instret is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.IR is also set, instret is further accessible to VS-mode.

When hcounteren.IR && scounteren.IR are both set, instret is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM3

Location

3

Description

When set, the hpmcounter3 CSR (an alias of mhpmcounter3) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM3 is also set, hpmcounter3 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM3 is also set, hpmcounter3 is further accessible to VS-mode.

When hcounteren.HPM3 && scounteren.HPM3 are both set, hpmcounter3 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM4

Location

4

Description

When set, the hpmcounter4 CSR (an alias of mhpmcounter4) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM4 is also set, hpmcounter4 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM4 is also set, hpmcounter4 is further accessible to VS-mode.

When hcounteren.HPM4 && scounteren.HPM4 are both set, hpmcounter4 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM5

Location

5

Description

When set, the hpmcounter5 CSR (an alias of mhpmcounter5) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM5 is also set, hpmcounter5 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM5 is also set, hpmcounter5 is further accessible to VS-mode.

When hcounteren.HPM5 && scounteren.HPM5 are both set, hpmcounter5 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM6

Location

6

Description

When set, the hpmcounter6 CSR (an alias of mhpmcounter6) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM6 is also set, hpmcounter6 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM6 is also set, hpmcounter6 is further accessible to VS-mode.

When hcounteren.HPM6 && scounteren.HPM6 are both set, hpmcounter6 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM7

Location

7

Description

When set, the hpmcounter7 CSR (an alias of mhpmcounter7) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM7 is also set, hpmcounter7 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM7 is also set, hpmcounter7 is further accessible to VS-mode.

When hcounteren.HPM7 && scounteren.HPM7 are both set, hpmcounter7 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM8

Location

8

Description

When set, the hpmcounter8 CSR (an alias of mhpmcounter8) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM8 is also set, hpmcounter8 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM8 is also set, hpmcounter8 is further accessible to VS-mode.

When hcounteren.HPM8 && scounteren.HPM8 are both set, hpmcounter8 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM9

Location

9

Description

When set, the hpmcounter9 CSR (an alias of mhpmcounter9) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM9 is also set, hpmcounter9 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM9 is also set, hpmcounter9 is further accessible to VS-mode.

When hcounteren.HPM9 && scounteren.HPM9 are both set, hpmcounter9 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM10

Location

10

Description

When set, the hpmcounter10 CSR (an alias of mhpmcounter10) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM10 is also set, hpmcounter10 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM10 is also set, hpmcounter10 is further accessible to VS-mode.

When hcounteren.HPM10 && scounteren.HPM10 are both set, hpmcounter10 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM11

Location

11

Description

When set, the hpmcounter11 CSR (an alias of mhpmcounter11) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM11 is also set, hpmcounter11 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM11 is also set, hpmcounter11 is further accessible to VS-mode.

When hcounteren.HPM11 && scounteren.HPM11 are both set, hpmcounter11 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM12

Location

12

Description

When set, the hpmcounter12 CSR (an alias of mhpmcounter12) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM12 is also set, hpmcounter12 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM12 is also set, hpmcounter12 is further accessible to VS-mode.

When hcounteren.HPM12 && scounteren.HPM12 are both set, hpmcounter12 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM13

Location

13

Description

When set, the hpmcounter13 CSR (an alias of mhpmcounter13) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM13 is also set, hpmcounter13 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM13 is also set, hpmcounter13 is further accessible to VS-mode.

When hcounteren.HPM13 && scounteren.HPM13 are both set, hpmcounter13 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM14

Location

14

Description

When set, the hpmcounter14 CSR (an alias of mhpmcounter14) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM14 is also set, hpmcounter14 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM14 is also set, hpmcounter14 is further accessible to VS-mode.

When hcounteren.HPM14 && scounteren.HPM14 are both set, hpmcounter14 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM15

Location

15

Description

When set, the hpmcounter15 CSR (an alias of mhpmcounter15) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM15 is also set, hpmcounter15 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM15 is also set, hpmcounter15 is further accessible to VS-mode.

When hcounteren.HPM15 && scounteren.HPM15 are both set, hpmcounter15 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM16

Location

16

Description

When set, the hpmcounter16 CSR (an alias of mhpmcounter16) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM16 is also set, hpmcounter16 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM16 is also set, hpmcounter16 is further accessible to VS-mode.

When hcounteren.HPM16 && scounteren.HPM16 are both set, hpmcounter16 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM17

Location

17

Description

When set, the hpmcounter17 CSR (an alias of mhpmcounter17) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM17 is also set, hpmcounter17 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM17 is also set, hpmcounter17 is further accessible to VS-mode.

When hcounteren.HPM17 && scounteren.HPM17 are both set, hpmcounter17 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM18

Location

18

Description

When set, the hpmcounter18 CSR (an alias of mhpmcounter18) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM18 is also set, hpmcounter18 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM18 is also set, hpmcounter18 is further accessible to VS-mode.

When hcounteren.HPM18 && scounteren.HPM18 are both set, hpmcounter18 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM19

Location

19

Description

When set, the hpmcounter19 CSR (an alias of mhpmcounter19) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM19 is also set, hpmcounter19 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM19 is also set, hpmcounter19 is further accessible to VS-mode.

When hcounteren.HPM19 && scounteren.HPM19 are both set, hpmcounter19 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM20

Location

20

Description

When set, the hpmcounter20 CSR (an alias of mhpmcounter20) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM20 is also set, hpmcounter20 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM20 is also set, hpmcounter20 is further accessible to VS-mode.

When hcounteren.HPM20 && scounteren.HPM20 are both set, hpmcounter20 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM21

Location

21

Description

When set, the hpmcounter21 CSR (an alias of mhpmcounter21) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM21 is also set, hpmcounter21 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM21 is also set, hpmcounter21 is further accessible to VS-mode.

When hcounteren.HPM21 && scounteren.HPM21 are both set, hpmcounter21 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM22

Location

22

Description

When set, the hpmcounter22 CSR (an alias of mhpmcounter22) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM22 is also set, hpmcounter22 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM22 is also set, hpmcounter22 is further accessible to VS-mode.

When hcounteren.HPM22 && scounteren.HPM22 are both set, hpmcounter22 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM23

Location

23

Description

When set, the hpmcounter23 CSR (an alias of mhpmcounter23) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM23 is also set, hpmcounter23 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM23 is also set, hpmcounter23 is further accessible to VS-mode.

When hcounteren.HPM23 && scounteren.HPM23 are both set, hpmcounter23 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM24

Location

24

Description

When set, the hpmcounter24 CSR (an alias of mhpmcounter24) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM24 is also set, hpmcounter24 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM24 is also set, hpmcounter24 is further accessible to VS-mode.

When hcounteren.HPM24 && scounteren.HPM24 are both set, hpmcounter24 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM25

Location

25

Description

When set, the hpmcounter25 CSR (an alias of mhpmcounter25) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM25 is also set, hpmcounter25 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM25 is also set, hpmcounter25 is further accessible to VS-mode.

When hcounteren.HPM25 && scounteren.HPM25 are both set, hpmcounter25 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM26

Location

26

Description

When set, the hpmcounter26 CSR (an alias of mhpmcounter26) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM26 is also set, hpmcounter26 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM26 is also set, hpmcounter26 is further accessible to VS-mode.

When hcounteren.HPM26 && scounteren.HPM26 are both set, hpmcounter26 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM27

Location

27

Description

When set, the hpmcounter27 CSR (an alias of mhpmcounter27) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM27 is also set, hpmcounter27 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM27 is also set, hpmcounter27 is further accessible to VS-mode.

When hcounteren.HPM27 && scounteren.HPM27 are both set, hpmcounter27 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM28

Location

28

Description

When set, the hpmcounter28 CSR (an alias of mhpmcounter28) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM28 is also set, hpmcounter28 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM28 is also set, hpmcounter28 is further accessible to VS-mode.

When hcounteren.HPM28 && scounteren.HPM28 are both set, hpmcounter28 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM29

Location

29

Description

When set, the hpmcounter29 CSR (an alias of mhpmcounter29) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM29 is also set, hpmcounter29 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM29 is also set, hpmcounter29 is further accessible to VS-mode.

When hcounteren.HPM29 && scounteren.HPM29 are both set, hpmcounter29 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM30

Location

30

Description

When set, the hpmcounter30 CSR (an alias of mhpmcounter30) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM30 is also set, hpmcounter30 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM30 is also set, hpmcounter30 is further accessible to VS-mode.

When hcounteren.HPM30 && scounteren.HPM30 are both set, hpmcounter30 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL

HPM31

Location

31

Description

When set, the hpmcounter31 CSR (an alias of mhpmcounter31) is accessible to <%- if ext?(:S) -%> S-mode. <%- else -%> U-mode. <%- end -%>

<%- if ext?(:S) -%> When scounteren.HPM31 is also set, hpmcounter31 is further accessible to U-mode. <%- end -%>

<%- if ext?(:H) -%> When hcounteren.HPM31 is also set, hpmcounter31 is further accessible to VS-mode.

When hcounteren.HPM31 && scounteren.HPM31 are both set, hpmcounter31 is further accessible to VU-mode. <%- end -%>

Type

RW

RO

Reset value

UNDEFINED_LEGAL