# helia_aot.platforms.defines

## helia_aot.platforms.defines.SocCapability

`class` · `python`

```python
SocCapability()
```

SoC available capabilities

Source: `helia_aot/platforms/defines.py:9`

### helia_aot.platforms.defines.SocCapability.MCU

`constant` · `python`

```python
MCU = auto()
```

Source: `helia_aot/platforms/defines.py:12`

### helia_aot.platforms.defines.SocCapability.DSP

`constant` · `python`

```python
DSP = auto()
```

Source: `helia_aot/platforms/defines.py:13`

### helia_aot.platforms.defines.SocCapability.USB

`constant` · `python`

```python
USB = auto()
```

Source: `helia_aot/platforms/defines.py:14`

### helia_aot.platforms.defines.SocCapability.BLE

`constant` · `python`

```python
BLE = auto()
```

Source: `helia_aot/platforms/defines.py:15`

### helia_aot.platforms.defines.SocCapability.MVE

`constant` · `python`

```python
MVE = auto()
```

Source: `helia_aot/platforms/defines.py:16`

### helia_aot.platforms.defines.SocCapability.PSRAM

`constant` · `python`

```python
PSRAM = auto()
```

Source: `helia_aot/platforms/defines.py:17`

### helia_aot.platforms.defines.SocCapability.FP16

`constant` · `python`

```python
FP16 = auto()
```

Source: `helia_aot/platforms/defines.py:18`

### helia_aot.platforms.defines.SocCapability.NPU

`constant` · `python`

```python
NPU = auto()
```

Source: `helia_aot/platforms/defines.py:19`

## helia_aot.platforms.defines.MemoryType

`class` · `python`

```python
MemoryType()
```

SoC available memory types

Source: `helia_aot/platforms/defines.py:22`

### helia_aot.platforms.defines.MemoryType.MRAM

`constant` · `python`

```python
MRAM = auto()
```

Source: `helia_aot/platforms/defines.py:25`

### helia_aot.platforms.defines.MemoryType.SRAM

`constant` · `python`

```python
SRAM = auto()
```

Source: `helia_aot/platforms/defines.py:26`

### helia_aot.platforms.defines.MemoryType.DTCM

`constant` · `python`

```python
DTCM = auto()
```

Source: `helia_aot/platforms/defines.py:27`

### helia_aot.platforms.defines.MemoryType.ITCM

`constant` · `python`

```python
ITCM = auto()
```

Source: `helia_aot/platforms/defines.py:28`

### helia_aot.platforms.defines.MemoryType.DRAM

`constant` · `python`

```python
DRAM = auto()
```

Source: `helia_aot/platforms/defines.py:29`

### helia_aot.platforms.defines.MemoryType.PSRAM

`constant` · `python`

```python
PSRAM = auto()
```

Source: `helia_aot/platforms/defines.py:30`

### helia_aot.platforms.defines.MemoryType.readable

`attribute` · `python`

```python
readable: bool
```

Check if this memory type is readable.

Source: `helia_aot/platforms/defines.py:33`

### helia_aot.platforms.defines.MemoryType.writeable

`attribute` · `python`

```python
writeable: bool
```

Check if this memory type is writeable.

Source: `helia_aot/platforms/defines.py:38`

### helia_aot.platforms.defines.MemoryType.executable

`attribute` · `python`

```python
executable: bool
```

Check if this memory type is executable.

Source: `helia_aot/platforms/defines.py:43`

### helia_aot.platforms.defines.MemoryType.is_init_ram

`attribute` · `python`

```python
is_init_ram: bool
```

Whether 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.

Source: `helia_aot/platforms/defines.py:48`

### helia_aot.platforms.defines.MemoryType.init_const_qualifier

`method` · `python`

```python
init_const_qualifier() -> str
```

C ``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**

| Name | Type | Description |
| --- | --- | --- |
| str | str | Either ``"const "`` or the empty string. Suitable |
|  | str | for direct interpolation in templates. |

Source: `helia_aot/platforms/defines.py:66`

### helia_aot.platforms.defines.MemoryType.to_qualifiers

`method` · `python`

```python
to_qualifiers(prefix: str = 'AOT', init: bool = False, writable: bool = True) -> str
```

Convert 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**

| Name | Type | Description |
| --- | --- | --- |
| str | str | C qualifier macro (e.g., AOT_PUT_IN_SRAM_INIT) |

Source: `helia_aot/platforms/defines.py:80`

## helia_aot.platforms.defines.SocPlatform

`class` · `python`

```python
SocPlatform()
```

Base class for SoC platforms

Source: `helia_aot/platforms/defines.py:129`

### helia_aot.platforms.defines.SocPlatform.name

`attribute` · `python`

```python
name: str = Field(..., description='Unique platform name')
```

Unique platform name

Source: `helia_aot/platforms/defines.py:142`

### helia_aot.platforms.defines.SocPlatform.min_alignment

`attribute` · `python`

```python
min_alignment: int | None = Field(..., description='Minimum alignment requirement in bytes')
```

Minimum alignment requirement in bytes

Source: `helia_aot/platforms/defines.py:143`

### helia_aot.platforms.defines.SocPlatform.cpu

`attribute` · `python`

```python
cpu: str = Field(default='cortex-m4', description='CPU architecture')
```

Source: `helia_aot/platforms/defines.py:144`

### helia_aot.platforms.defines.SocPlatform.speeds

`attribute` · `python`

```python
speeds: list[int] = Field(default_factory=list, description='List of supported clock speeds in MHz')
```

List of supported clock speeds in MHz

Source: `helia_aot/platforms/defines.py:145`

### helia_aot.platforms.defines.SocPlatform.memories

`attribute` · `python`

```python
memories: dict[MemoryType, int] = Field(default_factory=dict, description='Memory sizes in bytes')
```

Memory sizes in bytes

Source: `helia_aot/platforms/defines.py:146`

### helia_aot.platforms.defines.SocPlatform.capabilities

`attribute` · `python`

```python
capabilities: list[SocCapability] = Field(default_factory=list, description='List of SoC capabilities')
```

List of SoC capabilities

Source: `helia_aot/platforms/defines.py:147`

### helia_aot.platforms.defines.SocPlatform.preferred_memory_order

`attribute` · `python`

```python
preferred_memory_order: list[MemoryType] = Field(default_factory=list, description='Preferred memory order for allocations')
```

Preferred memory order for allocations

Source: `helia_aot/platforms/defines.py:148`

### helia_aot.platforms.defines.SocPlatform.supports_fp16

`attribute` · `python`

```python
supports_fp16: bool
```

Whether this platform supports Armv8.1-M MVE-FP / FP16 kernels.

Resolution order:

1. When :attr:`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.
2. When the capability is absent, FP16 is *inferred* from a normalized
   (case-insensitive) match of :attr:`cpu` against the known
   FP16-capable cores (``_FP16_CPUS``) for backward compatibility with
   platforms that only set ``cpu``.

Source: `helia_aot/platforms/defines.py:172`

### helia_aot.platforms.defines.SocPlatform.supports_npu

`attribute` · `python`

```python
supports_npu: bool
```

Whether 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.

Source: `helia_aot/platforms/defines.py:212`
