Home/Instructions/CBO-CLEAN
CBO.CLEAN

RISC-V CBO.CLEAN Instruction Details

Instruction ManualI-type

cache-block clean (Zicbom).

Instruction Syntax

cbo.clean offset(base)
Operand Breakdown
Destination rd: general-purpose register receiving the result.
Source rs1: register holding the first operand.
Immediate imm: 12-bit signed value, sign-extended before operation with rs1.
ZicbomCache & Sync

Instruction Behavior

CBO.CLEAN is a Zicbom cache-block management instruction that performs a clean operation on the cache block containing the effective address in rs1: if the copy in the coherent cache set was modified, a write transfer is performed so stores by coherent agents become visible to relevant non-coherent agents. The cache-block size is discovered from the execution environment and is not fixed at 64 bytes; the assembly offset may be omitted, and if present must evaluate to 0. An implementation may perform a flush instead of a clean.

CBO.CLEAN Decode And Cache-Block Animation

Shows the official CMO/prefetch encoding, offset(base) operands, effective-address-to-cache-block selection, and ISA-visible effects.

offset
base
cbo.clean
(
)
Execution Context
31..20
19..15
14..12
11..7
6..0
000000000001
cbo op
01011
rs1
010
funct3=CBO
00000
rd=x0
0001111
MISC-MEM
Cache-Block Data Path
instruction
0x0015A00F
opcode
0001111 -> MISC-MEM
operation
000000000001 -> CBO.CLEAN
funct3
010 -> CBO
offset/base
0(a1(x11))
effective addr
0x0000000000001018 + 0x0000000000000000 = 0x0000000000001018
cache block
0x0000000000001000..0x000000000000103F
operation
if a coherent-cache copy was modified, perform a write transfer visible to relevant non-coherent agents
complete
cache-block management semantics complete
Current Step

Receive the 32-bit CBO.CLEAN encoding

CBO.CLEAN uses a 32-bit encoding; the animation starts by splitting the official fields.

encoding: 0x0015A00F
syntax : cbo.clean 0(a1(x11))
effect : if a coherent-cache copy was modified, perform a write transfer visible to relevant non-coherent agents
Cache-Block Selection View
base
0x0000000000001018
EA
0x0000000000001018
target block
0x0000000000001000..0x000000000000103F

The example cache-block size is 64 bytes only to show how the address selects a block; the real size is discovered from the execution environment and is not fixed at 64 bytes.

This animation shows only architectural semantics from the RISC-V CMO extension: the effective address selects a cache block, execution can be environment-controlled, and prefetch is an ignorable HINT; it does not model concrete cache state, cache-line size, bus transactions, timing, or performance.

Quick Understanding & Search Notes

CBO.CLEAN is a CMO cache-block operation; it locates a cache block by effective address but is not an ordinary load/store.

For cbo.*, any explicit offset must be zero and the target is the cache block containing rs1.
CBO.INVAL/CLEAN/FLUSH executability is controlled by environment configuration.

Common Usage Scenarios

Atomic & Sync

Understand this scenario with real code like «cbo.clean 0(a1)».

Cache & Hints

Understand this scenario with real code like «cbo.clean 0(a1)».

Device & IO

Understand this scenario with real code like «cbo.clean 0(a1)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

The assembly offset operand may be omitted; if present, it must evaluate to zero.
rs1 need not be aligned to cache-block size; fault reporting uses the rs1 virtual address.
Execution permission is controlled by xenvcfg-related fields and privilege/virtualization state.

FAQ

Is CBO.CLEAN equivalent to a fence?

No. CMO/prefetch has cache-block semantics and is not a general memory-ordering substitute.

Must the address for CBO.CLEAN be cache-block aligned?

CBO instructions do not require rs1 to be aligned to cache-block size.