Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/analogdevicesinc/codefusion-studio/llms.txt

Use this file to discover all available pages before exploring further.

The cfsutil ai command group provides everything you need to integrate machine learning models into Analog Devices embedded targets, without opening the IDE. You can compile TensorFlow Lite models to deployable C/C++ source files, verify operator and memory compatibility before committing to a build, profile per-layer resource usage, and manage models within a workspace .cfsconfig file — all from the command line or a CI pipeline.
Windows dependency: On Windows, all cfsutil ai commands require the Visual C++ Redistributable for Visual Studio 2015 to be installed. Install this redistributable before running any cfsutil ai command.

Available subcommands

SubcommandDescription
cfsutil ai buildCompile a model into deployable C/C++ source code
cfsutil ai compatCheck model compatibility with a target SoC and core
cfsutil ai profileProfile model resource usage on target hardware
cfsutil ai model addAdd a model to a workspace .cfsconfig
cfsutil ai model listList models configured in a workspace
cfsutil ai model updateUpdate model properties in a workspace
cfsutil ai model removeRemove a model from a workspace
cfsutil ai workspace createGenerate a full workspace from a model file
cfsutil ai backends listList available AI backends (tflm, izer) and their extension fields
cfsutil ai clean-cacheClear the cache of remotely downloaded model and dataset files
Pass --help at any level for usage details:
cfsutil ai --help
cfsutil ai build --help
cfsutil ai model --help

Global options

The following options apply to all cfsutil ai commands.
FlagDescription
--format text|jsonOutput format. text (default) or json for machine-readable output
The --json flag was deprecated in CFS 2.2.0. Use --format json instead.

Data model search paths

The ai build, ai compat, and ai profile commands use a .cfsdatamodels index to look up SoC, core, and accelerator data. A default data model is bundled with the installation. To use a custom data model, pass -x / --search-path pointing to a directory containing your generated index file.
cfsutil ai build --search-path /path/to/data-models --soc MAX32690 --core CM4 --model model.tflite

cfsutil ai build

cfsutil ai build [--format text|json] [--config <value>] [-s <value>] [-p <value>] [-c <value>] \
  [-a <value>] [-m <value>] [--dataset <value>] [--cwd <value>] [-o <value>] \
  [--network-config <value>] [-b <value>] [-e <value>...] [-x <value>...] [--ignore-cache]
Compiles an AI/ML model for an embedded target, generating C or C++ source and header files. Supports two build modes: config-file mode (using --config) and flag-driven mode (using --model, --soc, --core).

Build from a .cfsconfig file

cfsutil ai build --config .cfs/max78002-csbga.cfsconfig
When --config is provided, --model, --soc, and --core are ignored. This mode builds all models defined in the configuration file at once. Sample output:
Created file "m4/src/adi_tflm/hello_world_f32.cpp"
Created file "m4/src/adi_tflm/hello_world_f32.hpp"
Created model "hello_world_f32"
Created file "m4/src/adi_tflm/adi_tflm.hpp"

Build from flags

FlagShortDescription
--soc-sTarget SoC (for example, MAX32690, MAX78002, ADSP-SC835)
--core-cTarget processor core (for example, CM4, FX, CM33)
--model-mPath or URL to the model file (.tflite, .pth.tar)
--package-pSoC package variant (for example, WLP, TQFN). Auto-detected if omitted
--acc-aHardware AI accelerator (for example, CNN for MAX78002)
--output-path-oOutput directory for generated files, relative to --cwd
--cwdChange the working directory (base for relative paths in .cfsconfig)
--datasetPath or URL to a sample dataset for quantization calibration
--backend-bName of the backend to use. Required if --extension is provided
--extension-eBackend-specific key=value pairs. Can be repeated
--network-configPath or URL to the Izer network configuration YAML. Required for izer backend
--search-path-xAdditional search path for templates and data models. Can be repeated
--ignore-cacheBypass cache and force a re-download of remote files
# Basic TFLM build
cfsutil ai build --model model.tflite --soc MAX32690 --core CM4

# With explicit package
cfsutil ai build --model model.tflite --soc MAX32690 --package WLP --core CM4

# SHARC FX core
cfsutil ai build --model model.tflite --soc ADSP-SC835 --core FX

# Custom output directory
cfsutil ai build --config .cfs/max78002-csbga.cfsconfig --output-path ./custom_folder

# Run from a different working directory
cfsutil ai build --config /path/to/project/.cfs/max78002-csbga.cfsconfig --cwd /path/to/project

CNN accelerator (izer backend) builds

To target the MAX78002 CNN accelerator, supply --acc CNN and a --network-config YAML file:
cfsutil ai build \
  --soc MAX78002 --core CM4 --acc CNN \
  --model https://raw.githubusercontent.com/analogdevicesinc/ai8x-synthesis/develop/trained/ai85-catsdogs-qat8-q.pth.tar \
  --network-config https://raw.githubusercontent.com/analogdevicesinc/ai8x-synthesis/develop/networks/cats-dogs-hwc-no-fifo.yaml
Pass backend-specific extension flags with -e:
cfsutil ai build \
  --soc MAX78002 --core CM4 --acc CNN \
  --model path/to/model.pth.tar \
  --network-config path/to/config.yaml \
  --backend izer \
  -e Softmax=True \
  -e InputShape=1,32,32
Use cfsutil ai backends list --name izer to see all available extension fields for the izer backend.

JSON output for CI

cfsutil ai build --config .cfs/max32690-tqfn.cfsconfig --format json
Sample JSON output:
[
  {
    "level": "INFO",
    "msg": "Created file \"m4/src/adi_tflm/hello_world_model_f32.cpp\"",
    "event": {
      "status": "OK",
      "type": "FILE",
      "value": "m4/src/adi_tflm/hello_world_model_f32.cpp"
    }
  },
  {
    "level": "INFO",
    "msg": "Created model \"hello_world_model_f32\"",
    "event": {
      "status": "OK",
      "type": "MODEL",
      "value": "hello_world_model_f32"
    }
  }
]

cfsutil ai compat

cfsutil ai compat [--format text|json] [-s <value>] [-p <value>] [-c <value>] \
  [-a <value>] [-m <value>] [-d <value>] [--report-file <value>] [-x <value>...] [--ignore-cache]
Checks whether a machine learning model can run on a supported processor by validating operator support, memory constraints, and data type compatibility. Currently supports TFLM models only (izer/PyTorch models on MAX78002 are not supported).

Flag reference

FlagShortDescription
--soc-sRequired. Target SoC
--core-cRequired. Target core
--model-mRequired. Path or URL to the model file
--package-pSoC package variant
--acc-aTarget accelerator
--dataset-dPath or URL to dataset for compatibility analysis
--report-filePath to write a JSON report file
--formatOutput format: text (default) or json
--search-path-xAdditional search path for data models. Can be repeated
--ignore-cacheBypass cache and fetch latest remote files
cfsutil ai compat --soc MAX32690 --core CM4 --model model.tflite
cfsutil ai compat --soc MAX32690 --core CM4 --package WLP --model model.tflite
cfsutil ai compat --soc MAX32690 --core CM4 --model model.tflite --format json
cfsutil ai compat --soc MAX32690 --core CM4 --model model.tflite --report-file report.json
The report covers three categories of issues:
  • Memory constraint issues — flash/RAM overflows (CRITICAL or WARNING severity)
  • Operator compatibility issues — unsupported operators with suggested alternatives
  • Data type compatibility issues — unsupported data types (for example, FLOAT32 when INT8 is required)

cfsutil ai profile

cfsutil ai profile [--format text|json] [-s <value>] [-p <value>] [-c <value>] \
  [-a <value>] [-m <value>] [--report-file <value>] [--report-format text|json] \
  [-x <value>...] [--ignore-cache]
Estimates memory usage, hardware performance, per-layer efficiency, and optimization opportunities for a model on the target device. Currently supports TFLM models only.

Flag reference

FlagShortDescription
--soc-sRequired. Target SoC
--core-cRequired. Target core
--model-mRequired. Path or URL to the model file
--package-pSoC package variant
--acc-aTarget accelerator
--report-filePath to write the report file
--report-formatReport file format: json (default) or text
--formatConsole output format: text (default) or json
--search-path-xAdditional search path for data models. Can be repeated
--ignore-cacheBypass cache and fetch latest remote files
cfsutil ai profile --soc MAX32690 --core CM4 --model model.tflite
cfsutil ai profile --soc MAX32690 --core CM4 --model model.tflite --report-file profile.json --report-format json
The profile report covers five sections: Model Summary, Memory Analysis, Hardware Performance, Per-Layer Performance, and Optimization Opportunities (layerwise memory and MAC suggestions).

cfsutil ai model

Manage AI models within a workspace .cfsconfig file. All model subcommands require either --config <path> or --workspace <path>. When both are provided, --config takes precedence.

ai model add

cfsutil ai model add --core <value> -m <value> [--format text|json] \
  [-w <value>] [--config <value>] [--dataset <value>] \
  [-a <value>] [--network-config <value>] [-e <value>...] [--ignore-cache]
Adds a model entry to the AIModels array in the .cfsconfig file. The model name is derived from the filename (without extension). A model with the same name cannot be added twice.
FlagShortDescription
--model-mRequired. Path or URL to the model file
--coreRequired. Target core (for example, CM4)
--configPath to the .cfsconfig file
--acc-aTarget accelerator (for example, CNN)
--extension-eBackend-specific key=value pairs. Can be repeated
--datasetPath or URL to a sample dataset
--network-configPath or URL to Izer network config YAML. Required for izer backends
--ignore-cacheBypass cache and fetch latest remote files
--formatOutput format: text or json
# Add a TFLM model
cfsutil ai model add --config .cfs/max32690.cfsconfig --core CM4 \
  --model path/to/model.tflite

# Add with custom symbol and memory section
cfsutil ai model add --config .cfs/max32690.cfsconfig --core CM4 \
  --model path/to/hello_world_f32.tflite \
  -e Symbol=hello_world_model -e Section=.data

# Add an izer model for MAX78002
cfsutil ai model add --config .cfs/max78002.cfsconfig --core CM4 \
  --acc CNN \
  --model path/to/model.pth.tar \
  --network-config path/to/network.yaml \
  -e Softmax=true

ai model list

cfsutil ai model list [--format text|json] [-w <value>] [--config <value>] [-c <value>] [--verbose]
FlagShortDescription
--configPath to the .cfsconfig file
--core-cFilter models by target core
--verboseShow backend, files, and extension details
--formatOutput format: text or json
cfsutil ai model list --config .cfs/max32690-tqfn.cfsconfig
cfsutil ai model list --config .cfs/max32690-tqfn.cfsconfig --core CM4 --verbose

ai model update

cfsutil ai model update --name <value> --set <value>... [--format text|json] \
  [-w <value>] [--config <value>] [-c <value>] [--ignore-cache]
Updates properties of an existing model using --set key=value. Can be repeated. Updatable core fields: name, enabled, model tflm extension fields: Symbol, Section, ArenaSize, ArenaSection, Dataset, DatasetSection izer extension fields: Softmax, Timer, Prefix, AvgPoolRounding, ClockDivider, InputShape, Fifo, NetworkConfig
cfsutil ai model update --config .cfs/max32690-tqfn.cfsconfig \
  --name hello_world_f32 --set name=hello_world_renamed

cfsutil ai model update --config .cfs/max78002-csbga.cfsconfig \
  --name cats-dogs --set Softmax=true --set ClockDivider=4

ai model remove

cfsutil ai model remove --name <value> [--format text|json] [-w <value>] [--config <value>]
cfsutil ai model remove --name hello_world_f32 --config .cfs/max32690-tqfn.cfsconfig

cfsutil ai workspace create

cfsutil ai workspace create -o <value> --name <value> --soc <value> --board <value> \
  --core <value> -m <value> [-s <value>...] [--dataset <value>] [-f]
Generates a complete CFS workspace from a model file. It runs a compatibility check, creates the workspace, integrates the model, and performs an initial build — all in one command.
FlagShortDescription
--output-oRequired. Output directory (workspace created inside it)
--nameRequired. Workspace name
--socRequired. SoC name
--boardRequired. Board name
--coreRequired. Target core
--model-mRequired. Path or URL to the model file
--datasetPath or URL to a sample dataset
--search-path-sAdditional search path for plugins and data models. Can be repeated
--skip-compat-fSkip the compatibility check before workspace creation
cfsutil ai workspace create \
  -o c:/tmp \
  --name myNewWorkspace \
  --soc MAX32690 \
  --board EvKit_V1 \
  --core CM4 \
  --model c:/models/model.tflite
Using --skip-compat bypasses hardware validation. The workspace will be created even if the model is incompatible with the target hardware. Use only when you are certain the model is supported.

cfsutil ai backends list

cfsutil ai backends list [--format text|json] [-n <value>]
Lists all available AI backends, or shows detailed information about a specific backend including supported hardware targets and extension fields.
# List all backends
cfsutil ai backends list

# Inspect the izer backend in detail
cfsutil ai backends list --name izer

# JSON output
cfsutil ai backends list --format json
Sample output (all backends):
tflm:  Generation for Tflite-micro run-time
izer:  ai8x-izer generation for MAX78002 CNN

cfsutil ai clean-cache

Clears the local cache of remotely downloaded model and dataset files. Use this to force re-downloading of updated remote files.
cfsutil ai clean-cache

Build docs developers (and LLMs) love