25#include <unicorn/unicorn.h>
37typedef enum : uint32_t {
87typedef enum : uint32_t {
102typedef enum : uint64_t {
Minimal self-contained macOS window for the board emulator.
struct board_view board_view_t
Opaque desktop-window handle (defined in board_view.m).
ELF32 image services for the board emulator (load / symbols / vectors).
Shared aliased-memory backing and Unicorn memory-map bindings.
struct emu_memmap_workspace emu_memmap_workspace_t
Independent aperture backing with at most two engine bindings.
Bounded raw-descriptor presentation surface and scratch workspace.
@ k_emu_presentation_max_panel_px
Largest panel dimension.
int emu_run_and_report(const emu_run_cfg_t *cfg)
Run the firmware to a stop condition, print the report, map the exit code.
emu_exit_t
Process exit codes for the #67 run-every-example matrix.
@ k_emu_exit_ok
Clean run-to-budget (no fault/BKPT/timeout).
@ k_emu_exit_bkpt
Firmware executed a BKPT (assert/give-up).
@ k_emu_exit_timeout
Wall-clock budget reached before a clean stop.
@ k_emu_exit_fault
Emulation fault / invalid access ended it.
@ k_run_inner_max
Per-chunk exception-resolve relaunch cap.
@ k_env_strtol_base
Decimal base for env-var integer parse.
@ k_op_wfi
Thumb wfi (wait-for-interrupt).
@ k_idle_loop_max
Largest idle loop (bytes) that may hold PC.
@ k_run_wall_s
Wall-clock safety bound (seconds).
@ k_run_chunk_insns
Instructions per emulation chunk.
@ k_run_max_chunks
Chunk budget.
@ k_low_power_div
Low-power: shrink the chunk budget by.
@ k_idle_scan_fwd
Halfwords scanned ahead for a loop edge.
@ k_bn_imm_sext_shl
Shift imm11 bit10 up to bit31 (sign bit).
@ k_bn_imm_sext_shr
Arith >> sign-extends and scales imm by 2.
@ k_op_bn_mask
Mask selecting a Thumb T2 b.n opcode.
@ k_idle_spin_insns
Budget when the core is parked on a wait-for-interrupt spin (a "b ." self-branch, wfi,...
@ k_op_branch_self
Thumb "b ." (branch-to-self idle loop).
@ k_op_bn_base
Thumb T2 unconditional b.n base value.
@ k_op_cpsie_i
Thumb cpsie i (re-enable IRQ in a poll).
@ k_op_bn_imm
Thumb T2 b.n imm11 field mask.
emu_misc_t
Named constants for ELF parsing, Thumb decode, and assorted literals.
@ k_cs_op_shift
CSEL-family op = hw2[13:12].
@ k_record_dir_mode
mkdir mode for the –record dir.
@ k_sectors_per_mib
512-byte sectors per MiB (–sd-new).
@ k_max_panel_px
Largest –size dimension.
@ k_thumb32_op5_min
op5 >= this -> 32-bit instruction.
@ k_thumb_op5_mask
5-bit op5 field.
@ k_thumb_op5_shift
op5 = hw0[15:11].
@ k_cs_op_mask
2-bit op field.
@ k_dump_sym_max
Max –dump-sym globals per run.
run_guards_t run_read_guards(const emu_run_cfg_t *cfg, const board_view_t *view)
Read the run-guard environment knobs (see run_guards_t).
emu_size_t
64-bit byte/size units used by –sd-new card sizing.
@ k_fat32_min_mib
FAT32 default threshold, in MiB.
@ k_bytes_per_sector
SD logical sector size in bytes.
@ k_size_kib
One kibibyte (k suffix multiplier).
@ k_sd_u32_max
32-bit sector-count ceiling.
Annotation-attribute framework macros for ra8-firmware.
One independently owned immutable raw-descriptor ELF source.
One independent owned surface plus non-owning bounded scratch.
Everything setup hands the run loop: engine, image, CLI products.
int click_y
–click row (composite pixels).
int click_x
–click column (composite pixels).
const char * record_dir
–record directory (NULL when unused).
bool want_click
–click armed.
const char * win_title
Window / sidebar caption.
bool want_view
–view (live window requested).
emu_elf_source_t * elf
Open caller-owned firmware source.
uint32_t initial_pc
Reset-vector PC (Thumb bit set).
bool want_trace
–trace (forwarded to warm reboots).
const char * ppm_path
–ppm output path (NULL when unused).
uint32_t stop_sym_thresh
–stop-sym threshold value.
uc_engine * uc
The prepared cpu0 engine.
const uint32_t * dump_sym_addrs
–dump-sym resolved addresses.
const char * save_sd_path
–save-sd dump path (NULL when unused).
uint32_t rotate_deg
–rotate display rotation.
uint32_t stop_sym_addr
–stop-sym resolved address (0 = off).
int reboot_count
–reboot N scheduled warm reboots.
emu_memmap_workspace_t * memory
Authoritative aliased-memory backing.
uint16_t view_h
Panel height in pixels.
uint32_t vtor_base
VTOR fallback (the MRAM vector base).
uint32_t record_secs
–record-secs bound (0 = unbounded).
const char *const * dump_sym_names
–dump-sym names (argv-backed).
uint32_t dump_sym_n
Count of –dump-sym entries.
emu_presentation_workspace_t * presentation
Owned streamed frame surface.
uint16_t view_w
Panel width in pixels.
The run-guard knobs (env-tunable budgets + stop conditions).
uint32_t max_chunks
Outer-chunk budget.
bool wall_guard_on
false: WALL_S=0 disabled the guard.
uint32_t prof_idle_arm
Chunks before the profiler stop arms.
const char * stop_on
Console-banner stop substring (or NULL).
uint32_t click_settle_chunks
Post-click drain window (chunks).
uint32_t idle_stop_chunks
Idle steady-state stop (0 = off).
uint32_t prof_idle_insns
Profiler idle chunk threshold.
uint32_t usbh_stop_settle
USB host-mode early-stop settle.
uint32_t prof_idle_need
Consecutive idle chunks that stop.
double wall_s
CPU-time guard bound, seconds.
uint32_t usb_stop_settle
USB device-mode early-stop settle.