Is PREFETCH.W equivalent to a fence?
No. CMO/prefetch has cache-block semantics and is not a general memory-ordering substitute.
data-write prefetch hint (Zicbop).
base / rs1: integer base register x0–x31; x0 always reads zero. The base need not be cache-block aligned.
offset: a sign-extended 12-bit byte displacement with five low zero bits; encodable multiples of 32 range from -2048 through 2016. The effective address wraps to XLEN.
There is no result register. Bits 11..7 are fixed to 00000 as offset[4:0]; bits 31..25 hold offset[11:5], while bits 24..20 are the fixed I/R/W operation selector.
PREFETCH.W is a Zicbop cache-block prefetch HINT indicating that the cache block at the effective address formed by rs1 plus sign-extended imm[11:0] is likely to be used for data write soon. The immediate requires imm[4:0]=0; an implementation may cache a copy in an appropriate cache to improve latency, but is not required to do so.
Shows the official CMO/prefetch encoding, offset(base) operands, effective-address-to-cache-block selection, and ISA-visible effects.
PREFETCH.W uses a 32-bit encoding; the animation starts by splitting the official fields.
The effective address is translated before selecting a physical cache block; this animation does not assume a virtual-to-physical mapping or cache-block size.
This animation shows only architectural semantics from the RISC-V CMO extension: the effective address is translated before a cache block is selected, CBO execution can be environment-controlled, and prefetch is an ignorable HINT; it does not model concrete cache state, physical mappings, cache-line size, bus transactions, timing, or performance.
PREFETCH.W is a CMO cache-block prefetch hint; it locates a cache block by effective address but is not an ordinary load/store.
Understand this scenario with real code like «prefetch.w 64(x11)».
Understand this scenario with real code like «prefetch.w 64(x11)».
No. CMO/prefetch has cache-block semantics and is not a general memory-ordering substitute.
No. The offset is a multiple of 32 in -2048..2016; the base need not be aligned. Add the sign-extended offset to the base, wrap to XLEN, then translate the effective address to select the physical cache block.