CIMFlow LogoCIMFlow

Instruction Set

Complete reference for CIM compute, communication, and control instructions

Instruction Overview

The instruction set is designed based on the RISC philosophy, with each fundamental instruction corresponding to one of three basic operations: compute, communication, and control flow.

Operation TypeMnemonicDescriptionKey Operands
Matrix–Vector OperationCIM_MVMMatrix–vector multiply-accumulate on in-memory-computing arrayinput-address, input-length, optional-flags, weight, batch
Vector OperationVEC_OPSingle-instruction multiple-data operationsrc1, src2, length, dst, functor
REDUCEVector reduction/aggregation operationsrc, length, dst, functor
Scalar Operation (Compute)SC_RRScalar data operationrs, rt, rd, functor
SC_RIrs, rd, functor
Scalar Operation (Comm)SC_LDScalar data load/storers, rd, offset
SC_STrs, rt, offset
G_LIScalar assignmentrd, imm
S_LIrd, imm
GS_MOVrs, rd
SG_MOVrs, rd
Data MovementMEM_CPYData copy among memory resources (local / global memory)src, length, dst
Inter-Core CommunicationSENDSend data across coressrc, dst, core-id, length, tag
RECVReceive data across coressrc, dst, core-id, length, tag
Intra-Core ControlBRANCHConditional branchrs, rt, offset, cond
JMPUnconditional jumpoffset
Inter-Core SynchronizationWAITWait for synchronization point from another coresrc-id, sync-id, expected-writes
BARRIERCollective barrier synchronizationcore-count, barrier-id
TAGMark synchronization point for other coressync-id

Instruction Encoding

Instructions are grouped by their encoding type: R, I-A, I-B, I-C, and J.

TypeInstruction31:2625:2120:1615:1110:65:10
RCIM_MVM000000rsrtrerfflags
VEC_OP01XX00rsrtrdrefunct
REDUCE010001rsrtrd0 0000funct
SC_RR100000rsrtrd0 0000funct
SEND110100rsrtrdrerf
RECV110110rsrtrdrerf
I-ASC_RI100100rsrdfunctimm
MEM_CPY1100XYrsrtrdimm
WAIT111101rsrtrd0 0000 0000 00
I-BSC_LD101000rsrdimm
SC_ST101001rsrtimm
GS_MOV101110rsrd0000 0000 0000 0000
SG_MOV101111rsrd0000 0000 0000 0000
BRANCH1110XXrsrtimm
BARRIER111110rsrt0000 0000 0000 0000
I-CG_LI101100rdimm
S_LI101101rdimm
TAG111111rs0 0000 0000 0000 0000 0000
JJMP111100imm

Last updated on