71 const uint32_t word = (uint32_t)addr & ~3U;
85 (void)uc_emu_stop(uc);
129 const uint32_t word = (uint32_t)((addr - base) / 4U);
130 const uint32_t bits = (uint32_t)value;
131 for (uint32_t b = 0U; b < 32U; b++) {
132 if ((bits & (1U << b)) != 0U) {
152typedef enum : uint64_t {
211 static uc_hook s_h_scb;
212 (void)uc_hook_add(uc,
223 static uc_hook s_h_nvic_iser;
224 static uc_hook s_h_nvic_icer;
225 (void)uc_hook_add(uc,
232 (void)uc_hook_add(uc,
Register-accurate peripheral-model framework for the board emulator.
void board_periph_nvic_set_enable(uint32_t irq, bool enable)
Set or clear a NVIC line's enable in the model's set-enable shadow.
Emulator text-console surfaces: UART echo, ITM/SWO echo, escapes.
@ k_scb_demcr_trcena
DEMCR bit 24: trace subsystem enable.
@ k_scb_demcr_addr
Debug Exception + Monitor Control.
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.
static void wr32(uc_engine *uc, uint64_t addr, uint32_t v)
Write a 32-bit little-endian word to emulated memory.
Cortex-M exception model constants and interfaces for ra8_emulator.
@ k_scb_ccr
Configuration and Control (CCR).
@ k_nvic_en_span
Byte span of one set/clear array.
@ k_scb_aircr
App interrupt/reset control (AIRCR).
@ k_aircr_sysresetreq
AIRCR.SYSRESETREQ bit (request reset).
@ k_ccr_div_0_trp
CCR.DIV_0_TRP bit4: divide-by-0 traps.
static RA8_INTERNAL void internal_on_scb_ctrl_write(uc_engine *uc, uc_mem_type type, uint64_t addr, int size, int64_t value, void *user)
UC_HOOK_MEM_WRITE handler for the SCB control words AIRCR and CCR.
dwt_model_t
Data Watchpoint and Trace (DWT) cycle-counter register model.
@ k_dwt_ctrl_addr
DWT_CTRL (bit 0 CYCCNTENA).
@ k_dwt_cyccnt_addr
DWT_CYCCNT free-running cycle counter.
@ k_dwt_ctrl_cyccntena
DWT_CTRL.CYCCNTENA: counter enable.
@ k_dwt_cyccnt_per_chunk
Cycles charged per outer chunk (==.
void dwt_cyccnt_advance(uc_engine *uc)
Advance the DWT cycle counter by one outer chunk's worth of cycles.
static RA8_INTERNAL void internal_on_nvic_en_write(uc_engine *uc, uc_mem_type type, uint64_t addr, int size, int64_t value, void *user)
UC_HOOK_MEM_WRITE handler for the NVIC ISER / ICER arrays.
void emu_exc_clear_reboot_request(void)
Implementation of emu_exc_clear_reboot_request() – plain clear.
bool emu_exc_reboot_requested(void)
Implementation of emu_exc_reboot_requested() – plain flag read.
void emu_exc_install_scb_nvic(uc_engine *uc)
Implementation of emu_exc_install_scb_nvic() – SCB ctrl + NVIC hooks.
static bool s_reboot_request
AIRCR.SYSRESETREQ observed: the run loop performs a warm reboot.
Armv8.1-M instruction-emulation seams (M85 ops on Unicorn's M33).
void div0_patch_sites(uc_engine *uc)
Overwrite every tracked divide with UDF so divide-by-zero can trap.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
@ k_nvic_icer_base
NVIC Interrupt Clear-Enable Register array.
@ k_nvic_iser_base
NVIC Interrupt Set-Enable Register array.