25typedef enum : uint32_t {
42typedef enum : uint64_t {
115 for (uint32_t i = 0U; i <
s_mmio_n; i++) {
129uint64_t
mmio_read(uc_engine* uc, uint64_t offset,
unsigned size,
void* user)
135 bool handled =
false;
179 for (uint32_t i = 0U; i <
s_mmio_n; i++) {
187void mmio_write(uc_engine* uc, uint64_t offset,
unsigned size, uint64_t value,
void* user)
202 bool handled =
false;
253 (void)
priv_emu_io_errf(
" %-12s %10s %10s %12s\n",
"addr",
"reads",
"writes",
"last-write");
256 for (uint32_t i = 0U; i < shown; i++) {
Register-accurate peripheral-model framework for the board emulator.
void board_periph_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value, bool *handled)
Dispatch an MMIO write to the owning block, if any.
uint64_t board_periph_read(uc_engine *uc, uint64_t addr, unsigned size, bool *handled)
Dispatch an MMIO read to the owning block, if any.
Second-core (cpu1, Cortex-M33) engine: release watch, boot, stepping.
void emu_cpu1_notify_mmio_write(uint64_t mmio_abs, uint64_t value)
Watch a peripheral MMIO write for the cpu1 release sequence.
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.
static uint32_t s_bgc_distinct_n
void emu_mmio_print_counts(void)
Implementation of emu_mmio_print_counts() – run-end report line.
static uint32_t s_mmio_wcount[k_mmio_slots]
static uint32_t s_bgc_distinct[k_bgc_track_max]
static uint32_t s_mmio_val[k_mmio_slots]
void mmio_write(uc_engine *uc, uint64_t offset, unsigned size, uint64_t value, void *user)
UC_MMIO write callback for the peripheral window.
static uint32_t s_mmio_reads
static uint32_t s_mmio_rcount[k_mmio_slots]
uint32_t mmio_peek(uint64_t addr)
Side-effect-free read of the last value written to a peripheral reg.
@ k_mrms_freq_mask
Key byte (bits[31:24]) stripped.
@ k_mrms_mrefreq
MRPCLK freq latch (write key 0xE1).
@ k_mrms_mrcfreq
MRICLK freq latch (write key 0x1E).
uint32_t emu_mmio_writes(void)
Implementation of emu_mmio_writes() – plain counter read.
static int s_mmio_cache
1-entry address->slot lookup cache.
static uint32_t s_bgc_writes
emu_mmio_cfg_t
Sparse-model sizing and settle thresholds.
@ k_mmio_slots
Distinct MMIO addresses tracked.
@ k_mmio_print_max
Max MMIO rows printed in the summary.
@ k_mmio_settle
Same-addr reads before a poll "settles".
@ k_u32_all_ones
All bits set (MMIO read toggle).
static uint32_t s_mmio_toggle
static RA8_INTERNAL int internal_mmio_index(uint64_t addr)
Find (or add) a slot for a distinct MMIO address; -1 if table full.
static bool s_mmio_written[k_mmio_slots]
static int s_mmio_run_slot
Slot of the current read run.
static RA8_INTERNAL void internal_bgc_track(uint32_t value)
Record a BG_BGC write; remember the value if it is a new colour.
uint64_t mmio_read(uc_engine *uc, uint64_t offset, unsigned size, void *user)
UC_MMIO read callback for the peripheral window.
static uint32_t s_mmio_writes
void emu_mmio_print_bgc_and_table(void)
Implementation of emu_mmio_print_bgc_and_table() – run-end report.
static uint64_t s_mmio_addr[k_mmio_slots]
static uint32_t s_mmio_run
Consecutive reads of that slot.
uint32_t emu_mmio_reads(void)
Implementation of emu_mmio_reads() – plain counter read.
Sparse MMIO model of the Renesas peripheral space.
@ k_periph_base
Peripheral window base.
@ k_bgc_track_max
Distinct BG_BGC values remembered.
@ k_glcdc_bg_bgc
GLCDC BG.BGC background colour.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).