Skip to content
heliaAOT
Guides
HELIA HUB

Toolchains and build environments

Use this page when choosing a compiler or adapting a generated module to a firmware build. A format supported by the templates, a successful cross-build, a simulator execution and a physical-board run establish different things.

For a complete first application, use Firmware integration. This page explains the requirements behind those recipes.

The repository defines the following checks. They describe the coverage of the test setup; they do not certify every model, compiler version or board build. Heavy CI jobs also depend on the pull request’s CI routing policy.

Environment Support and evidence Integrator supplies
Arm GNU Toolchain The CMake end-to-end harness cross-builds and executes on Corstone-300 FVP using apollo4p_blue_kbr_evb and apollo510_evb conversion configurations. The FVP’s processor is a Cortex-M55, so the Cortex-M4 build for apollo4p_blue_kbr_evb runs on a Cortex-M55 model. Native-contract tests separately use host GCC and a pinned kernel library. Matching kernel build, CPU flags, startup and linker configuration.
Host Clang A CI job converts every example that needs no hardware and compiles each generated translation unit against the pinned kernel library with clang 15 on x86-64 Linux, and runs the host-compile tests with it. It does not build for an Arm target. A target build with their own Clang-based toolchain.
Arm Compiler for Embedded (armclang) Declared by the NSX manifest and represented in generated attribute guards; no repository CI job builds with it. Compatible compiler/licence, SDK and kernel library; qualification of the actual firmware build.
Arm Toolchain for Embedded (atfe) Declared by NSX and uses the Clang attribute path; no repository CI job builds with it. Toolchain, SDK/kernel compatibility and build qualification.
IAR Planned; not listed by the NSX manifest and no repository CI build qualifies it. Compiler/SDK-specific attribute and header validation before relying on it.
Zephyr A real west build compiles and links a generated add_scalar_s8 module for Apollo510 against Zephyr and CMSIS 6. Verification is disabled in this compile-only fixture; it is not executed by that job. West workspace, Zephyr SDK, Ambiq HAL/CMSIS modules and ns-cmsis-nn extra module.
FreeRTOS The generated model API has no FreeRTOS dependency; there is no repository FreeRTOS application test. Application task ownership, synchronization, SDK and memory setup.
Standalone CMake The default module format, used by the FVP build harness; emits a static library requiring CMake 3.15 or newer. Complete firmware parent project and compatible kernel linkage.
NSX Manifest/build-file generation is covered; no repository job runs neuralSPOT-X. The emitted transfer provider of a module with dma units is compiled against the pinned nsx-ambiq-sdk headers and run on the host against a fake nsx-psram. NSX board layer, NSX_BOARD_FLAGS_TARGET and nsx::cmsis_nn; with dma units, nsx::psram (nsx-psram API 1.1.0 or newer).
CMSIS-Pack Evaluation. Unit tests invoke packchk with XSD validation disabled and permit specific unresolved-dependency warnings. No consuming pack application is built. Pack-aware build tool, installed kernel dependency and consumer build validation.
Bare metal The FVP harness builds and executes a bare-metal image. Startup, device configuration, linker script and physical-board qualification for your target.

Release qualification runs the release models on the FVP at two optimization levels, applied to heliaCORE, the generated module and the test application: -Ofast (ns-cmsis-nn’s default) for both configurations, and -Os (Zephyr’s default) again for apollo510_evb. A release is promoted only when every cell passes. Ordinary pull-request e2e runs at -Ofast only. If your firmware builds at another level, qualify the module at that level too. The release models are int8 networks, and keyword-spotting and ResNet-8 networks in float32, in float16 (on apollo510_evb only) and with int16 activations.

Version pins and minimum library requirements are on Version requirements. Simulator execution is useful functional evidence; it is not an Ambiq board timing measurement.

For the optional preparation route install helia-aot[ethos]. The qualified Python 3.11 environment uses helia-ethos 0.4.0 and Vela 5.2.0. A binary-only Python 3.14 Linux installation of that extra requires a Vela wheel, which 5.2.0 does not publish for that interpreter. The base package can convert already compiled models. A standalone heliaAOT executable includes the adapter and its data; fresh preparation also requires an external Vela executable on the search path. Retained-record replay uses the verified compiled file.

The simulator case uses FVP_Corstone_SSE-300_Ethos-U55 with the real Ethos-U core driver, Cortex-M55, and cpu0.CFGDTCMSZ=12 and cpu0.CFGITCMSZ=12. Its original int8 CNN golden uses tolerance 10. For an AT110 modeling experiment, the released upstream atomiq110 SoC profile declares U85-256 and the atomiq110-model-v10 policy. Explicit settings include mode: ULP, const: hblram, arena: ssram, cache: ssram and memory_mode: Shared_Sram. The U55 simulator result above applies to the Corstone-300 profile. Target configuration and example

Set model.preparation.compile.arena_cache_size to the number of bytes Vela should model, for example 32768 for 32 KiB. It defaults to zero. The retained preparation.json records the request in compiler.arena_cache_size and the modeled bank in compiler.placement.cache. A bare compiled LiteRT file does not carry that compiler policy. Vela’s summary uses KiB. With Performance optimization the requested size is a target. With Size optimization, Dedicated SRAM still enforces a limit on cache and staging. SRAM Only and Shared SRAM ignore it.

For a Vela U85 COP1 model, a shared scratch operand keeps one allocation. Distinct ordinary and fast scratch roots can occupy separate writable banks or aligned, disjoint spans in one bank. For example, the public AT110 U85-256 CNN compiled with memory_mode: Dedicated_Sram and a 32 KiB request needs 9,456 bytes of ordinary scratch and 25,152 bytes of fast scratch. In this compiled file, memory.tensors rules can pin tensor ID 2 to hblram and ID 3 to sram (AT110 SSRAM). Inspect the operands for each compiled file before choosing IDs. When passing imported AIR to convert(model=...), keep the compiled command bytes, operand order, buffer extents and staging uses together. Recompile the source model to change that layout.

The placement report’s placement.allocations gives the generated base slices and their byte extents. Ordinary activation slices can overlap within the same arena. Read placement.memories[].used for total planned bytes per bank, including the static fast buffer. The driver can replace physical base slot 2 after reservation. Its allocation reports the planned memory and omits physical_memories because firmware chooses the runtime backing. A zero-length dedicated fast operand keeps its slot with address and size zero and adds no arena bytes. Firmware D-cache maintenance depends on the memory attributes and transfer path.

What the emitted code assumes of a compiler

Section titled “What the emitted code assumes of a compiler”

Language and library requirements. Generated CMake libraries request c_std_99. The generated common header also includes stdalign.h, generated buffers use alignment declarations. Generated README files call for a target-compatible C toolchain and distinguish the CMake C99 declaration from the C11 host checks. Use the language support required by the complete SDK/kernel build rather than treating the CMake declaration as proof of strict C99 portability.

The model uses preplanned buffers rather than a runtime heap allocator. Its sources depend on the kernel headers and can use C library memory/math helpers. The optional test harness adds logging and target counter access. Float and Ethos-U paths bring additional dependencies described in Precision and Targets.

Compiler extensions and placement. NSX code placement in ITCM uses guarded GCC-style section attributes. Zephyr uses its own section macros, with target-specific DTCM mapping. CMake and pack output leave the placement hooks empty for the application to define. Staged-constant hydration also has a weak-symbol override. Audit these constructs and the underlying SDK and heliaCORE when qualifying a toolchain. An unrecognized compiler may take an empty hook; do not infer placement from a successful build.

Logging. Zephyr selects printk only with CONFIG_PRINTK. CMake, NSX and pack output default to no logging. Overrides must reach generated translation units, not only the application’s main.c.

Concurrency. Serialize model calls, arena rebinding and constant hydration. The arena table and hydration latch are module-global. Two contexts do not provide independent concurrent instances. Under an RTOS, define one owner or protect the complete inference/state-update sequence with application synchronization.

Checks in the repository. Strict host compilation and C++ consumer tests check emitted syntax and headers, including extern "C" placement. These do not replace compilation with the actual target headers, compiler, libraries and linker script. The version guard in aot_common.h checks the ns-cmsis-nn floor; it cannot establish correct firmware configuration or execution.

How the module types map to build environments

Section titled “How the module types map to build environments”
module.type Entry files Integration recipe
zephyr zephyr/module.yml, Kconfig, CMakeLists.txt Zephyr application
cmake Root CMakeLists.txt CMake
nsx CMakeLists.txt, nsx-module.yaml; with dma units under module.transfer_provider: auto, src/<prefix>_nsx_transfer.c and includes-api/<prefix>_nsx_transfer.h NSX
cmsis_pack (evaluation) .pdsc, optionally a .pack archive CMSIS-Pack

For another build system, the CMake source list and public include directory identify the module inputs. Carry over required definitions, dependency linkage, logging and placement hooks as well as the .c files.

Start by compiling and linking the actual generated module against the intended SDK and ns-cmsis-nn. Inspect the linker map for alignment and physical placement, then run the enabled golden comparison. Retain the compiler version, flags, library revision and logs with that evidence.

For support, report the compiler/version, module.type, target, model configuration and the first build or runtime failure through Support. Template compatibility alone should not be described as a tested deployment.