mhpmevent22

Machine Hardware Performance Counter 22 Control

Programmable hardware performance counter event selector <% if ext?(:Sscofpmf) %> and overflow/filtering control<% end %>

Attributes

Defining Extension

  • Smhpm, version >= 0

CSR Address

0x336

Length

64-bit

Privilege Mode

M

Format

mhpmevent22 format
Figure 1. mhpmevent22 format

Field Summary

Name Location Type Reset Value

mhpmevent22.OF

63

[when,"HPM_COUNTER_EN[22]"] RW-H [when,"!(HPM_COUNTER_EN[22])"] RO

[when,"HPM_COUNTER_EN[22]"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22])"] 0

mhpmevent22.MINH

62

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

[when,"HPM_COUNTER_EN[22]"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22])"] 0

mhpmevent22.SINH

61

[when,"HPM_COUNTER_EN[22] && implemented?(ExtensionName::S && CSR[misa].S == 1’b1)"] RW [when,"!HPM_COUNTER_EN[22] && implemented?(ExtensionName::S && CSR[misa].S == 1’b1)"] RO

[when,"(HPM_COUNTER_EN[22] && implemented?(ExtensionName::S))"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22] && implemented?(ExtensionName::S))"] 0

mhpmevent22.UINH

60

[when,"HPM_COUNTER_EN[22] && implemented?(ExtensionName::U && CSR[misa].U == 1’b1)"] RW [when,"!HPM_COUNTER_EN[22] && implemented?(ExtensionName::U && CSR[misa].U == 1’b1)"] RO

[when,"(HPM_COUNTER_EN[22] && implemented?(ExtensionName::U))"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22] && implemented?(ExtensionName::U))"] 0

mhpmevent22.VSINH

59

[when,"(HPM_COUNTER_EN[22]) && implemented?(ExtensionName::H && CSR[misa].H == 1’b1)"] RW [when,"!(HPM_COUNTER_EN[22]) && implemented?(ExtensionName::H && CSR[misa].H == 1’b1)"] RO

[when,"(HPM_COUNTER_EN[22] && implemented?(ExtensionName::H))"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22] && implemented?(ExtensionName::H))"] 0

mhpmevent22.VUINH

58

[when,"HPM_COUNTER_EN[22] && implemented?(ExtensionName::H && CSR[misa].H == 1’b1)"] RW [when,"!HPM_COUNTER_EN[22] && implemented?(ExtensionName::H && CSR[misa].H == 1’b1)"] RO

[when,"HPM_COUNTER_EN[22]) && implemented?(ExtensionName::H"] UNDEFINED_LEGAL [when,"!HPM_COUNTER_EN[22]) && implemented?(ExtensionName::H"] 0

mhpmevent22.EVENT

57:0

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

[when,"HPM_COUNTER_EN[22]"] UNDEFINED_LEGAL [when,"!(HPM_COUNTER_EN[22])"] 0

Fields

OF

Location

63

Description

Overflow status and interrupt disable.

The OF bit is set when the corresponding hpmcounter overflows, and remains set until written by software. Since hpmcounter values are unsigned values, overflow is defined as unsigned overflow of the implemented counter bits.

The OF bit is sticky; it stays set until explicitly cleared by a CSR write.

A Local Counter Overflow Interrupt (LCOFI) is generated when OF is clear and mhpmcounter22 overflows.

Type
RW-H
RO
Reset value
UNDEFINED_LEGAL
0

MINH

Location

62

Description

When set, mhpmcounter22 does not increment while the hart in operating in M-mode.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

SINH

Location

61

Description

When set, mhpmcounter22 does not increment while the hart in operating in (H)S-mode.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

UINH

Location

60

Description

When set, mhpmcounter22 does not increment while the hart in operating in U-mode.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

VSINH

Location

59

Description

When set, mhpmcounter22 does not increment while the hart in operating in VS-mode.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

VUINH

Location

58

Description

When set, mhpmcounter22 does not increment while the hart in operating in VU-mode.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

EVENT

Location

57:0

Description

Event selector for performance counter mhpmcounter22.

Type
RW
RO
Reset value
UNDEFINED_LEGAL
0

Software write

This CSR may store a value that is different from what software attempts to write.

When a software write occurs (e.g., through csrrw), the following determines the written value:

OF = csr_value.OF
MINH = csr_value.MINH
SINH = csr_value.SINH
UINH = csr_value.UINH
VSINH = csr_value.VSINH
VUINH = csr_value.VUINH
EVENT = if (ary_includes?<$array_size(HPM_EVENTS), 58>(HPM_EVENTS, csr_value.EVENT)) {
  return csr_value.EVENT;
} else {
  return UNDEFINED_LEGAL_DETERMINISTIC;
}