minstret

Machine Instructions Retired Counter

Counts the number of instructions retired by this hart from some arbitrary start point in the past.

Instructions that cause synchronous exceptions, including ecall and ebreak, are not considered to retire and hence do not increment the minstret CSR.

Attributes

Defining Extension

  • Zicntr, version >= 0

CSR Address

0xb02

Length

64-bit

Privilege Mode

M

Format

minstret format
Figure 1. minstret format

Field Summary

Name Location Type Reset Value

minstret.COUNT

63:0

RW-H

UNDEFINED_LEGAL

Fields

COUNT

Location

63:0

Description

Instructions retired counter.

<%- if ext?(:Zicntr) -%> Aliased as instret.COUNT. <%- end -%>

Increments every time an instruction retires unless:

  • mcountinhibit.IR <%- if ext?(:Smcdeleg) -%>or its alias scountinhibit.IR<%- end -%> is set <%- if ext?(:Smcntrpmf) -%>

  • minstretcfg.MINH is set and the current privilege level is M <%- if ext?(:S) -%>

  • minstretcfg.SINH <%- if ext?(:Ssccfg) -%>or its alias instretcfg.SINH<%- end -%> is set and the current privilege level is (H)S <%- end -%> <%- if ext?(:U) -%>

  • minstretcfg.UINH <%- if ext?(:Ssccfg) -%>or its alias instretcfg.SINH<%- end -%> is set and the current privilege level is U <%- end -%> <%- if ext?(:H) -%>

  • minstretcfg.VSINH <%- if ext?(:Ssccfg) -%>or its alias instretcfg.SINH<%- end -%> is set and the current privilege level is VS

  • minstretcfg.VUINH <%- if ext?(:Ssccfg) -%>or its alias instretcfg.SINH<%- end -%> is set and the current privilege level is VU <%- end -%> <%- end -%>

An instruction that causes an exception, notably including MRET/SRET, does not retire and does not cause minstret.COUNT to increment.

Type

RW-H

Reset value

UNDEFINED_LEGAL