SocCapability
PythonSoC available capabilities
SocCapability()SocCapabilityclassSoC available capabilitiesMemoryTypeclassSoC available memory typesSocPlatformclassBase class for SoC platformsSoC available capabilities
SocCapability()SoC available memory types
MemoryType()SoC available memory types
MRAM = auto()SRAM = auto()DTCM = auto()ITCM = auto()DRAM = auto()PSRAM = auto()Check if this memory type is readable.
readable: boolCheck if this memory type is readable.
Check if this memory type is writeable.
writeable: boolCheck if this memory type is writeable.
Check if this memory type is executable.
executable: boolCheck if this memory type is executable.
Whether the INIT placement for this memory targets loadable RAM.
is_init_ram: boolWhether the _INIT placement for this memory targets loadable RAM.
Memories whose *_INIT linker macro places symbols into
loadable RAM (i.e. the section is writable at the linker
level, with bytes copied from a load region at boot) cannot
be declared const at the C type level — GNU ld will
otherwise infer a read-only section group, refuse to merge
with the writable RAM section, and orphan the symbol into an
unrelated output section.
C const prefix appropriate for an INIT blob in this memory.
init_const_qualifier() -> strC const prefix appropriate for an _INIT blob in this memory.
Returns "const " for memories whose init section is
read-only at link time (flash/XIP), and "" for memories
whose init section is loadable RAM (where const would
cause a section-flag conflict — see :attr:is_init_ram).
Returns
| Value | Type | Description |
|---|---|---|
str | str | Either ``"const "`` or the empty string. Suitable |
str | for direct interpolation in templates. |
Convert memory placement to C qualifiers
to_qualifiers(prefix: str = 'AOT', init: bool = False, writable: bool = True) -> strConvert memory placement to C qualifiers
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
prefix | str | 'AOT' | Prefix for the qualifier macro |
init | bool | False | For pre-initialized data (aka .data) vs zeroed (.bss) |
writable | bool | True | Whether the data will be written to at runtime |
Returns
| Value | Type | Description |
|---|---|---|
str | str | C qualifier macro (e.g., AOT_PUT_IN_SRAM_INIT) |
Base class for SoC platforms
SocPlatform()Base class for SoC platforms
name: str = Field(..., description='Unique platform name')Unique platform name
min_alignment: int | None = Field(..., description='Minimum alignment requirement in bytes')Minimum alignment requirement in bytes
cpu: str = Field(default='cortex-m4', description='CPU architecture')speeds: list[int] = Field(default_factory=list, description='List of supported clock speeds in MHz')List of supported clock speeds in MHz
memories: dict[MemoryType, int] = Field(default_factory=dict, description='Memory sizes in bytes')Memory sizes in bytes
capabilities: list[SocCapability] = Field(default_factory=list, description='List of SoC capabilities')List of SoC capabilities
preferred_memory_order: list[MemoryType] = Field(default_factory=list, description='Preferred memory order for allocations')Preferred memory order for allocations
Whether this platform supports Armv8.1-M MVE-FP / FP16 kernels.
supports_fp16: boolWhether this platform supports Armv8.1-M MVE-FP / FP16 kernels.
Resolution order:
SocCapability.FP16 is declared explicitly, it is
honored as a platform/toolchain capability. It is rejected only when
it contradicts a known non-FP16 core (_NON_FP16_CPUS, e.g.
Cortex-M4/M7/M33); unknown or custom CPUs are trusted so bespoke or
future MVE-FP targets can opt in through the extension point without
a library change.cpu against the known
FP16-capable cores (_FP16_CPUS) for backward compatibility with
platforms that only set cpu.Whether this platform declares an attached NPU (Arm Ethos-U).
supports_npu: boolWhether this platform declares an attached NPU (Arm Ethos-U).
Unlike :attr:supports_fp16 there is no CPU-based inference: the NPU
is a discrete accelerator that cannot be deduced from the core, so the
capability must be declared explicitly via :attr:SocCapability.NPU.
Operators that generate NPU-only code (e.g. the Ethos-U custom
operator) use this to reject conversion for platforms without an
accelerator at convert time, instead of failing later in the
integrator’s build.