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.
Available subcommands
| Subcommand | Description |
|---|
cfsutil ai build | Compile a model into deployable C/C++ source code |
cfsutil ai compat | Check model compatibility with a target SoC and core |
cfsutil ai profile | Profile model resource usage on target hardware |
cfsutil ai model add | Add a model to a workspace .cfsconfig |
cfsutil ai model list | List models configured in a workspace |
cfsutil ai model update | Update model properties in a workspace |
cfsutil ai model remove | Remove a model from a workspace |
cfsutil ai workspace create | Generate a full workspace from a model file |
cfsutil ai backends list | List available AI backends (tflm, izer) and their extension fields |
cfsutil ai clean-cache | Clear 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.
| Flag | Description |
|---|
--format text|json | Output 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
| Flag | Short | Description |
|---|
--soc | -s | Target SoC (for example, MAX32690, MAX78002, ADSP-SC835) |
--core | -c | Target processor core (for example, CM4, FX, CM33) |
--model | -m | Path or URL to the model file (.tflite, .pth.tar) |
--package | -p | SoC package variant (for example, WLP, TQFN). Auto-detected if omitted |
--acc | -a | Hardware AI accelerator (for example, CNN for MAX78002) |
--output-path | -o | Output directory for generated files, relative to --cwd |
--cwd | | Change the working directory (base for relative paths in .cfsconfig) |
--dataset | | Path or URL to a sample dataset for quantization calibration |
--backend | -b | Name of the backend to use. Required if --extension is provided |
--extension | -e | Backend-specific key=value pairs. Can be repeated |
--network-config | | Path or URL to the Izer network configuration YAML. Required for izer backend |
--search-path | -x | Additional search path for templates and data models. Can be repeated |
--ignore-cache | | Bypass 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
| Flag | Short | Description |
|---|
--soc | -s | Required. Target SoC |
--core | -c | Required. Target core |
--model | -m | Required. Path or URL to the model file |
--package | -p | SoC package variant |
--acc | -a | Target accelerator |
--dataset | -d | Path or URL to dataset for compatibility analysis |
--report-file | | Path to write a JSON report file |
--format | | Output format: text (default) or json |
--search-path | -x | Additional search path for data models. Can be repeated |
--ignore-cache | | Bypass 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
| Flag | Short | Description |
|---|
--soc | -s | Required. Target SoC |
--core | -c | Required. Target core |
--model | -m | Required. Path or URL to the model file |
--package | -p | SoC package variant |
--acc | -a | Target accelerator |
--report-file | | Path to write the report file |
--report-format | | Report file format: json (default) or text |
--format | | Console output format: text (default) or json |
--search-path | -x | Additional search path for data models. Can be repeated |
--ignore-cache | | Bypass 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.
| Flag | Short | Description |
|---|
--model | -m | Required. Path or URL to the model file |
--core | | Required. Target core (for example, CM4) |
--config | | Path to the .cfsconfig file |
--acc | -a | Target accelerator (for example, CNN) |
--extension | -e | Backend-specific key=value pairs. Can be repeated |
--dataset | | Path or URL to a sample dataset |
--network-config | | Path or URL to Izer network config YAML. Required for izer backends |
--ignore-cache | | Bypass cache and fetch latest remote files |
--format | | Output 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]
| Flag | Short | Description |
|---|
--config | | Path to the .cfsconfig file |
--core | -c | Filter models by target core |
--verbose | | Show backend, files, and extension details |
--format | | Output 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.
| Flag | Short | Description |
|---|
--output | -o | Required. Output directory (workspace created inside it) |
--name | | Required. Workspace name |
--soc | | Required. SoC name |
--board | | Required. Board name |
--core | | Required. Target core |
--model | -m | Required. Path or URL to the model file |
--dataset | | Path or URL to a sample dataset |
--search-path | -s | Additional search path for plugins and data models. Can be repeated |
--skip-compat | -f | Skip 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.