Webcentive RISC-V Reference

prefetch.w

Cache block prefetch for data write

Extension
Zicbom/Zicbop/Zicboz
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
prefetch.w imm(xs1)
Length
32-bit

Encoding

listed in riscv-opcodes as a pseudo-op of ori

31252420191514121176210
imm[11:5]00011rs1110000000010011

Match 0x00306013, mask 0x01f07fff. Source: $pseudo_op rv_i::ori prefetch.w rs1 imm12hi 24..20=3 14..12=6 11..7=0 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv_zicbo.

FieldBitsriscv-opcodes name
imm[11:5]31:25imm12hi
rs119:15rs1

Description

A prefetch.w instruction indicates to hardware that the cache block whose effective address is the sum of the base address specified in xs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] equals 0b00000, is likely to be accessed by a data write (i.e. store) in the near future.

Description from riscv-unified-db, reformatted.

Operation

XReg address = X[xs1] + $signed(imm << 5);
prefetch_write(address);

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages