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

CSR Address

0xb02

Defining extension

  • Zicntr, version >= 0

Length

64-bit

Privilege Mode

M

Format

minstret format
Figure 1. minstret format

Field Summary

Name Location Type Reset Value

COUNT

63:0

RW-H

UNDEFINED_LEGAL

Fields

COUNT

Location

minstret[63:0]

Description

Instructions retired counter.

Aliased as instret.COUNT.

Increments every time an instruction retires unless:

  • mcountinhibit.IR or its alias scountinhibit.IR is set

  • minstretcfg.MINH is set and the current privilege level is M

  • minstretcfg.SINH or its alias instretcfg.SINH is set and the current privilege level is (H)S

  • minstretcfg.UINH or its alias instretcfg.SINH is set and the current privilege level is U

  • minstretcfg.VSINH or its alias instretcfg.SINH is set and the current privilege level is VS

  • minstretcfg.VUINH or its alias instretcfg.SINH is set and the current privilege level is VU

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

Type

RW-H

Read-Write with Hardware update

Field is writable by software. Any value that fits in the field is acceptable. Hardware also updates the field without an explicit software write.

Reset value

UNDEFINED_LEGAL