CIMFlow LogoCIMFlow

Domain Specific Language

CIM-DSL for programming Computing-in-Memory architectures

CIM-DSL is a domain-specific language designed for Computing-in-Memory architectures. It combines Python-like syntax with explicit memory management and hardware-aware operations.


Quick Start

def main() {
    input = Buffer(<32, 32>, int8, __INPUT_MEMORY__);
    output = Buffer(<32>, int32, __OUTPUT_MEMORY__);

    Trans(global_input, input);
    SIMD(VVADD, input[0, :], input[1, :], output);
}

Functions

Functions are defined with typed parameters specifying shape, datatype, and memory location:

def main(null<int8>) {
    // Program entry point
}
def process(input< <4, 8>, int8, __LOCAL__>) {
    // Function body
}

Tile Declaration

Allocate memory blocks with the Buffer function:

input = Buffer(<3, 32, 32>, int8, __INPUT_MEMORY__);
weight = Buffer(<64, 128>, int8, __LOCAL__);

Tile shapes must be compile-time constants. Use <-1> for dynamic dimensions.


Data Types

int1
Binary
int8
8-bit
int32
32-bit
int64
64-bit
index
Index
fp16
Half float
float32
Float

Memory Types

GLOBALOff-chip shared memory
LOCALOn-chip SRAM per core
INPUT_MEMORYInput buffer region
OUTPUT_MEMORYOutput buffer region
MACROCIM macro array
CIM_INPUT_REG_BUFFERCIM input registers
CIM_OUTPUT_REG_BUFFERCIM output registers
ANYWildcard for parameters

Last updated on