RISC-V ISA Explorer · System

Zicntr: Base Counters/Timers

Ratified 2019-12 · version 2.0.0

Unprivileged read access to the CYCLE, TIME and INSTRET counters for cycle count, real time and instructions retired.

Typical use: Cycle and instruction counting for profiling

Specification

Open Zicntr in the explorer

Dependencies

Requires

Instructions (6)

MnemonicNameEncodingMatchMask
RDCYCLE11000000000000000010-----11100110xc00020730xfffff07f
RDCYCLEH11001000000000000010-----11100110xc80020730xfffff07f
RDINSTRET11000000001000000010-----11100110xc02020730xfffff07f
RDINSTRETH11001000001000000010-----11100110xc82020730xfffff07f
RDTIME11000000000100000010-----11100110xc01020730xfffff07f
RDTIMEH11001000000100000010-----11100110xc81020730xfffff07f

Control and status registers (7)

NameAddressModeDescription
cycle0xc00UCycle counter for RDCYCLE Instruction
cycleh0xc80UHigh-half cycle counter for RDCYCLE Instruction
instret0xc02UInstructions retired counter for RDINSTRET Instruction
instreth0xc82UInstructions retired counter, high bits
minstreth0xb82MMachine Instructions Retired Counter
time0xc01UTimer for RDTIME Instruction
timeh0xc81UHigh-half timer for RDTIME Instruction