EoSim Developer Documentation v0.1.0

Multi-architecture embedded simulation platform. Supports native Python simulation, binary emulation, and hardware-in-the-loop (HIL) testing across ARM, RISC-V, Xtensa, and x86 targets. Python CLI (eosim) with optional Tkinter GUI.

💻 Architecture

EoSim CLI / GUI
  |
  +-- Platform Registry (52 platforms from YAML files)
  |       |              |              |
  |  Native Engine   Binary Engine  HIL Bridge
  |  (Python sim)    (ARM/RV/x86)   (OpenOCD/Serial)
  |  GPIO,UART,SPI   Full binary    Real hardware
  |  I2C,Timer,ADC   execution      via debug probe
  |
  +-- 3D Renderers (drone, robot, vehicle, aircraft, medical, satellite)
  +-- GUI Dashboard (GPIO panel, UART terminal, CPU state, memory view)

📄 eosim list

eosim list [options]

List all simulation platforms from the registry. Supports filtering and grouping. Output: table (default), JSON, or CSV.

Options
--arch <name>stringFilter: arm, arm64, riscv64, xtensa, x86_64.
--vendor <name>stringFilter: ST, NXP, Nordic, Espressif, Renesas, TI, Microchip, NVIDIA.
--class <name>stringFilter: mcu, sbc, soc, edge-server.
--engine <name>stringFilter: native, qemu, hil.
--domain <name>stringFilter: automotive, industrial, medical, iot, robotics, aerospace.
--group-by <f>stringGroup by: arch, vendor, class, engine, domain.
--format <fmt>stringOutput: table, json, csv.
Example
$ eosim list --arch arm --class mcu

Available platforms (8):
  NAME                ARCH    ENGINE   VENDOR     CLASS  DESCRIPTION
  -------------------------------------------------------------------
  stm32f4             arm     native   ST         mcu    STM32F407 Cortex-M4F
  stm32h7             arm     native   ST         mcu    STM32H743 Cortex-M7
  nrf52               arm     native   Nordic     mcu    nRF52840 Cortex-M4F
  nrf5340             arm     native   Nordic     mcu    nRF5340 Cortex-M33
  k64f                arm     native   NXP        mcu    Kinetis K64 Cortex-M4F
  samc21              arm     native   Microchip  mcu    SAMC21 Cortex-M0+
  psoc6               arm     native   Infineon   mcu    PSoC 6 Cortex-M4F
  s32k344             arm     qemu     NXP        mcu    S32K344 Cortex-M7
eosim search <query>

Fuzzy search platforms by name, vendor, SoC, or architecture.

Parameters
querystringSearch term.
Example
$ eosim search nordic
Search results for 'nordic' (3 matches):
  nrf52     arm   native  Nordic  nRF52840
  nrf5340   arm   native  Nordic  nRF5340
  nrf9160   arm   qemu    Nordic  nRF9160

▶ eosim run

eosim run <platform> [options]

Start simulation for a platform. Loads YAML config, initializes engine (native/binary emulation), optionally loads firmware.

Options
--firmware <path>stringELF or BIN firmware to load.
--engine <type>stringOverride: native, qemu.
--gdb-port <N>intGDB server port (default: 3333).
--uart-port <N>intUART TCP bridge port (default: 4444).
--guiflagOpen GUI dashboard.
--headlessflagNo GUI or terminal.
--timeout <sec>intAuto-stop after N seconds.
Example
$ eosim run stm32f4 --firmware build/my-robot.elf --gui

[eosim] Platform: stm32f4 (STM32F407VG)
[eosim] Engine: native (Python peripheral simulation)
[eosim] Peripherals: GPIO(144), UART(6), SPI(6), I2C(3), TIM(14), ADC(3)
[eosim] GDB server: localhost:3333
[eosim] UART bridge: localhost:4444
[eosim] GUI dashboard opened
[eosim] Simulation running... (Ctrl+C to stop)

📊 eosim stats

eosim stats

Show platform registry statistics: total count, breakdown by architecture, vendor, engine, class, and domain.

Example
$ eosim stats
Platform Registry Statistics:
  Total platforms: 52
  By Architecture:  arm: 22, arm64: 10, riscv64: 3, riscv32: 2, xtensa: 3, x86_64: 2, mipsel: 2, powerpc: 1, microblaze: 1, arc: 1, tricore: 1, rh850: 1
  By Engine:        native: 32, qemu: 16, hil: 4
  By Class:         mcu: 20, sbc: 10, soc: 5, devboard: 5, virtual: 4, automotive: 3, safety: 3, fpga: 1, industrial: 1
  By Vendor:        ST: 5, Broadcom: 5, Nordic: 3, NXP: 3, Espressif: 3, TI: 3, ARM: 3, NVIDIA: 2, ...

🎨 eosim gui

eosim gui [platform]

Open the EoSim GUI dashboard (Tkinter). Includes: GPIO pin visualizer, UART terminal, CPU state panel, memory viewer, peripheral register inspector, and optional 3D product renderers (drone, robot, vehicle, aircraft, medical, satellite).

Options
platformstringOptional platform to auto-start simulation.
Example
$ eosim gui stm32f4
# Opens Tkinter window with:
# - GPIO panel: 144 pins, click to toggle, color by state
# - UART terminal: real-time serial output
# - CPU panel: registers, PC, SP, flags, clock
# - Memory view: hex dump of RAM/Flash regions
# - Peripheral registers: TIM, ADC, SPI, I2C config

📜 Platform YAML Format

# platforms/stm32f4/platform.yml
name: stm32f4
display_name: "STM32F407VG Discovery"
arch: arm
vendor: ST
soc: STM32F407VG
platform_class: mcu
engine: native
domain: iot

cpu:
  core: cortex-m4f
  fpu: true
  mpu: true
  clock_hz: 168000000
  icache: false
  dcache: false

memory:
  flash_kb: 1024
  ram_kb: 192
  ccm_kb: 64       # Core-coupled memory

peripherals:
  gpio: { ports: [A,B,C,D,E,F,G,H,I], pins_per_port: 16 }
  uart: { count: 6, max_baud: 10500000 }
  spi:  { count: 6, max_clock_hz: 42000000 }
  i2c:  { count: 3, max_clock_hz: 400000 }
  timer: { count: 14, bits: [16, 32] }
  adc:  { count: 3, channels: 16, resolution: 12 }
  dac:  { count: 2, channels: 2, resolution: 12 }
  dma:  { count: 2, streams: 16 }
  usb:  { otg_fs: true, otg_hs: true }
  can:  { count: 2 }
  sdio: { count: 1 }
  ethernet: { count: 1 }

debug:
  interface: SWD
  gdb_port: 3333
  uart_bridge_port: 4444

qemu:
  machine: netduinoplus2
  cpu: cortex-m4

⚙ Simulation Engines

EngineTypeSpeedFidelityUse Case
nativePython simulationFastMediumRapid prototyping, CI testing, peripheral logic verification. Simulates GPIO, UART, SPI, I2C, Timer, ADC registers in Python.
qemuBinary emulationMediumHighFull firmware execution on emulated CPU. Uses EoSim binary emulation with GDB and QMP interfaces. Supports ARM, RISC-V, Xtensa, x86.
hilHardware-in-loopReal-timeExactReal hardware via debug probe (OpenOCD/J-Link). Bridges serial and GDB. Highest fidelity for production validation.

🔌 Native Engine Peripheral Registers

The native engine simulates peripheral register maps in Python. Each peripheral provides read/write access to memory-mapped registers.

GPIO Register Map (per port)

OffsetRegisterDescription
0x00MODERMode register: 2 bits per pin (00=input, 01=output, 10=AF, 11=analog).
0x04OTYPEROutput type: 0=push-pull, 1=open-drain.
0x08OSPEEDRSpeed: 00=low, 01=med, 10=high, 11=vhigh.
0x0CPUPDRPull-up/down: 00=none, 01=up, 10=down.
0x10IDRInput data (read-only, 16 bits).
0x14ODROutput data (read/write, 16 bits).
0x18BSRRBit set/reset (write-only, atomic).
0x1CLCKRLock register.
0x20AFRLAlternate function low (pins 0-7).
0x24AFRHAlternate function high (pins 8-15).

UART Register Map

OffsetRegisterDescription
0x00SRStatus: TXE, RXNE, TC, IDLE, ORE, NE, FE, PE flags.
0x04DRData register (read=RX, write=TX).
0x08BRRBaud rate register (mantissa + fraction).
0x0CCR1Control: UE, TE, RE, RXNEIE, TCIE, TXEIE, M, OVER8.
0x10CR2Control: STOP bits, CLKEN, LINEN.
0x14CR3Control: DMAT, DMAR, CTSE, RTSE.

Timer Register Map

OffsetRegisterDescription
0x00CR1Control: CEN, UDIS, URS, OPM, DIR, ARPE.
0x0CDIERDMA/interrupt enable: UIE, CC1IE, CC2IE, TIE.
0x10SRStatus: UIF, CC1IF, CC2IF, TIF.
0x24CNTCounter value.
0x28PSCPrescaler.
0x2CARRAuto-reload value.
0x34CCR1Capture/compare channel 1.

EoSim requires Python 3.10+. Binary emulation engine requires qemu-system binaries installed. HIL engine requires OpenOCD and a compatible debug probe. Install: pip install eosim.