CIMFlow LogoCIMFlow

Run and CLI

Command reference for CIMFlow compiler commands and native cim-compiler tools

The compiler can be invoked through cimflow compile for standard workflows or the cim-compiler native binary for advanced use.

Which Command to Use

cimflow compile
Standard CIMFlow workflow with automatic config resolution
cim-compiler
Native binary for advanced options, visualization, and developer tools

CIMFlow Compile Command

The cimflow compile command provides CG-level and OP-level compilation with automatic config resolution.

cimflow compile cg \
  -m model.onnx \
  -o output/cg \
  -t 8 -k 16 -b 16 -c 64 \
  --batch-size 8 --strategy dp

cimflow compile op \
  -i output/cg/instructions_*.json \
  -o output/op \
  -cf config.json


Native Binary

The native cim-compiler binary provides additional commands and options not exposed through cimflow compile.

cim-compiler [--log-level LEVEL] COMMAND [OPTIONS]

Global Options

OptionDescription
--log-levelTRACE, DEBUG, VERBOSE, INFO, WARNING, ERROR
--version, -VPrint compiler version

Compilation Commands

These commands appear when you run cim-compiler --help.

Flag Case Difference

The native cim-compiler uses uppercase flags (-T, -K, -B, -C) while cimflow compile uses lowercase (-t, -k, -b, -c).

Developer Commands

The following commands are not shown in cim-compiler --help but are available for specialized use cases: format conversion, instruction inspection, behavioral simulation, and config template generation.

CommandPurpose
compileCompile CIM-DSL source to final_code.json
convertConvert instruction formats (json/asm)
showDisplay instruction file in human-readable assembly
simulateBuilt-in behavioral simulation (distinct from the cycle-accurate cim-simulator)
multi-core-simulateMulti-process behavioral simulation
opSingle-operator compilation/testing workflow
configGenerate compiler-format config from template
cfg_cimsimGenerate simulator-format config from template

Advanced Examples

# DSL source -> final_code.json
cim-compiler compile -i code.cim -o output/codegen -c config.json

# JSON ISA -> ASM
cim-compiler convert --src-type json --dst-type asm --src-file isa.json --dst-file isa.asm

# Inspect instruction stream
cim-compiler show -i isa.json --type json

Last updated on