39typedef enum : uint64_t {
46typedef enum : uint32_t {
104 bool*
const present = (
bool*)opaque;
126 bool present =
false;
163 uc_engine* c1 =
nullptr;
164 if (uc_open(UC_ARCH_ARM, (uc_mode)(UC_MODE_THUMB | UC_MODE_MCLASS), &c1) != UC_ERR_OK) {
167 (void)uc_ctl_set_cpu_model(c1, UC_CPU_ARM_CORTEX_M33);
173 (void)
priv_emu_io_errf(
" cpu1 engine : Cortex-M33, shared SRAM + peripherals (dual-core)\n");
205 (void)uc_reg_write(
s_cpu1_uc, UC_ARM_REG_SP, &cpu1_sp);
212 if (e1 != UC_ERR_OK) {
Emulator text-console surfaces: UART echo, ITM/SWO echo, escapes.
dual_core_addr_t
CPU_CTRL registers + activation bit for the second core (cpu1).
@ k_cpu1_actcsr_addr
CPU_CTRL.CPU1ACTCSR (16-bit).
@ k_cpu1_mram_base
MRAM_CPU1: cpu1 image base.
@ k_cpu1_mram_end
MRAM_CPU1 end (256 KiB).
@ k_cpu1_initvtor_addr
CPU_CTRL.CPU1INITVTOR (32-bit).
static uc_engine * internal_cpu1_engine_init(const emu_elf_source_t *elf, emu_memmap_workspace_t *memory)
Create the second emulator engine for cpu1 (Cortex-M33), if present.
@ k_cpu1_actcsr_key
KEY[15:8] required to honor a write.
@ k_cpu1_actcsr_actreq
CPU1ACTCSR.ACTREQ -> release cpu1.
@ k_cpu1_actcsr_key_mask
KEY byte mask after the shift.
@ k_cpu1_actcsr_key_shift
KEY byte position (bits [15:8]).
@ k_cpu1_chunk_insns
cpu1 instructions per interleave.
void emu_cpu1_close(emu_memmap_workspace_t *memory)
Detach and close the optional cpu1 engine.
static bool s_cpu1_release_req
CPU1ACTCSR.ACTREQ observed.
static bool s_cpu1_active
cpu1 released and stepping.
static bool internal_cpu1_segment(const elf_exec_segment_t *segment, void *opaque)
True if elf carries a PT_LOAD segment in the cpu1 MRAM window.
void emu_cpu1_init(const emu_elf_source_t *elf, emu_memmap_workspace_t *memory)
Implementation of emu_cpu1_init() – detect + build the engine.
static uint32_t s_cpu1_initvtor
Captured CPU1INITVTOR value.
static uint32_t s_cpu1_pc
cpu1 run PC across interleaves.
static bool internal_cpu1_image_present(const emu_elf_source_t *elf)
Detect a PT_LOAD segment in the cpu1 MRAM window.
static uc_engine * s_cpu1_uc
2nd engine for cpu1 (NULL if N/A).
void emu_cpu1_step(void)
Implementation of emu_cpu1_step() – release boot + one interleave.
void emu_cpu1_notify_mmio_write(uint64_t mmio_abs, uint64_t value)
Implementation of emu_cpu1_notify_mmio_write() – release capture.
Second-core (cpu1, Cortex-M33) engine: release watch, boot, stepping.
ELF32 image services for the board emulator (load / symbols / vectors).
uint32_t elf_foreach_load_segment(const emu_elf_source_t *elf, elf_exec_segment_fn fn, void *ctx)
Walk every non-empty, bounds-checked PT_LOAD segment.
int load_elf(uc_engine *uc, const emu_elf_source_t *elf)
Load ELF32 PT_LOAD segments into emulated memory at their LMA.
Shared Unicorn engine access utilities for the board emulator.
static uint32_t rd32(uc_engine *uc, uint64_t addr)
Read a 32-bit little-endian word from emulated memory.
Bounded raw-descriptor I/O seam for the RA8 emulator.
emu_io_result_t priv_emu_io_errf(const char *format,...)
Format bounded text and write it to the injected error descriptor.
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.
@ k_emu_memmap_ok
Operation completed exactly.
emu_memmap_result_t emu_memmap_attach(emu_memmap_workspace_t *workspace, uc_engine *uc)
Map one Unicorn engine onto the shared aperture backing.
bool emu_memmap_detach(emu_memmap_workspace_t *workspace, uc_engine *uc)
Remove one engine binding before closing that Unicorn engine.
Sparse MMIO model of the Renesas peripheral space.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
One executable PT_LOAD segment, already bounds-checked against the image.
uint32_t paddr
Segment physical load address.
One independently owned immutable raw-descriptor ELF source.