Skip to content

defines

Classes

SocCapability

SoC available capabilities

MemoryType

SoC available memory types

Attributes

readable property
readable: bool

Check if this memory type is readable.

writeable property
writeable: bool

Check if this memory type is writeable.

executable property
executable: bool

Check if this memory type is executable.

is_init_ram property
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.

Returns:

  • bool ( bool ) –

    True for RAM-class memories (DTCM, SRAM, ITCM,

  • bool

    PSRAM); False for flash-class memories (MRAM) whose

  • bool

    init section is genuinely read-only and accepts const.

Functions

init_const_qualifier
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:

  • str ( str ) –

    Either "const " or the empty string. Suitable

  • str

    for direct interpolation in templates.

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

Convert memory placement to C qualifiers

Parameters:

  • prefix
    (str, default: 'AOT' ) –

    Prefix for the qualifier macro

  • init
    (bool, default: False ) –

    For pre-initialized data (aka .data) vs zeroed (.bss)

  • writable
    (bool, default: True ) –

    Whether the data will be written to at runtime

Returns:

  • str ( str ) –

    C qualifier macro (e.g., AOT_PUT_IN_SRAM_INIT)

SocPlatform

Base class for SoC platforms

Attributes:

  • name (str) –

    Unique platform name

  • speeds (list[int]) –

    List of supported clock speeds in MHz

  • memories (dict[MemoryType, int]) –

    Memory sizes in bytes

  • capabilities (list[SocCapability]) –

    List of SoC capabilities

  • preferred_memory_order (list[MemoryType]) –

    Preferred memory order for allocations

  • min_alignment (int | None) –

    Minimum alignment requirement in bytes