sctrclr
Supervisor Control Transfer Record (CTR) clear
- Extension
- Ssctr
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
sctrclr- Length
- 32-bit
Encoding
| 3120 | 1915 | 1412 | 117 | 62 | 10 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 000100000100 | 00000 | 000 | 00000 | 11100 | 11 | ||||||||||||||||||||||||||
Match 0x10400073, mask 0xffffffff. Source: sctrclr 11..7=0 19..15=0 31..20=0x104 14..12=0 6..2=0x1C 1..0=3 in riscv-opcodes/extensions/rv_ssctr.
Description
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.CCandctrdata.CCVbit 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:
Smctris not implemented- The instruction is executed in S/VS/VU-mode and
Ssctris not implemented, ormstateen0.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
Description from riscv-unified-db, reformatted.