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.
Syntax
Control flow, slicing, operators
Built-in Functions
Memory, SIMD, CIM operations
Examples
Kernel implementations
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
int1Binary
int88-bit
int3232-bit
int6464-bit
indexIndex
fp16Half float
float32Float
Memory Types
GLOBALOff-chip shared memoryLOCALOn-chip SRAM per coreINPUT_MEMORYInput buffer regionOUTPUT_MEMORYOutput buffer regionMACROCIM macro arrayCIM_INPUT_REG_BUFFERCIM input registersCIM_OUTPUT_REG_BUFFERCIM output registersANYWildcard for parametersLast updated on