ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

sctrclr

T1 riscv alu insn
Supervisor Control Transfer Record (CTR) clear
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Smctr, Ssctr
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsSmctr, Ssctr

Summary

When mstateen0.CTR=1, the SCTRCLR instruction performs the following operations:

Syntax / Encoding

sctrclr | 00010000010000000000000001110011 (mask=0xffffffff match=0x10400073)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV000100000100000000000000011100110xffffffff / 0x10400073

Reference Notes

When `mstateen0.CTR`=1, the SCTRCLR instruction performs the following operations:

* Zeroes all CTR Entry Registers, for all DEPTH values
* Reset to Zero the optional CTR cycle counter where implemented
** `ctrdata.CC` and `ctrdata.CCV` bit fields.

Any read of `ctrsource`, `ctrtarget`, or `ctrdata` that follows SCTRCLR, such that it precedes the next
qualified control transfer, will return the value 0.

Further, the first recorded transfer following SCTRCLR will have `ctrdata.CCV`=0.

SCTRCLR execution causes an `IllegalInstruction` exception if:

* `Smctr` is not implemented
* The instruction is executed in S/VS/VU-mode and `Ssctr` is not implemented, or `mstateen0.CTR`=0
* The instruction is executed in U-mode

SCTRCLR execution  causes a `VirtualInstruciton` exception if `mstateen0.CTR`=1 and:

* The instruction is executed in VS-mode and `hstateen0.CTR`=0
* The instruction is executed in VU-mode