45typedef enum : uint64_t {
57typedef enum : uint8_t {
68typedef enum : uint32_t {
96 s_cac.cacntbr = (uint16_t)(((uint32_t)
s_cac.callvr + (uint32_t)
s_cac.caulvr) / 2U);
131 const uint64_t off = addr - (uint64_t)
k_cac_base;
145 return s_cac.cacntbr;
167 const uint64_t off = addr - (uint64_t)
k_cac_base;
169 s_cac.cacr0 = (uint8_t)value;
185 s_cac.caulvr = (uint16_t)value;
187 s_cac.callvr = (uint16_t)value;
201 if (
s_cac.meas == 0U) {
206 (
unsigned)
s_cac.cacntbr,
207 (
unsigned)
s_cac.callvr,
208 (
unsigned)
s_cac.caulvr);
Decentralized peripheral-block registry for the board emulator core.
void board_periph_register_block(const board_periph_block_t *block)
Register a peripheral block's descriptor with the core registry.
static RA8_INTERNAL uint64_t internal_cac_read(uc_engine *uc, uint64_t addr, unsigned size)
MMIO read inside the CAC window.
static RA8_INTERNAL void internal_cac_block_register(void)
Register the CAC block before main (host constructor).
cac_field_t
CACR0 / CASTR / CAICR field masks (ra8_cac.c).
@ k_cac_cacr0_cfme
CACR0.CFME measurement enable (bit 0).
@ k_cac_castr_ovff
CASTR.OVFF counter-overflow (bit 2).
@ k_cac_caicr_ferrfcl
CAICR.FERRFCL clear FERRF (bit 4).
@ k_cac_caicr_ovffcl
CAICR.OVFFCL clear OVFF (bit 6).
@ k_cac_castr_mendf
CASTR.MENDF measurement-end (bit 1).
@ k_cac_caicr_mendfcl
CAICR.MENDFCL clear MENDF (bit 5).
@ k_cac_castr_ferrf
CASTR.FERRF frequency-error (bit 0).
static RA8_INTERNAL void internal_cac_report(void)
End-of-run CAC section: measurements + last count and window.
cac_order_t
Per-tick order slot for the CAC block (relative order only).
@ k_cac_block_order
After the DRW block; report order.
static RA8_INTERNAL void internal_cac_measure(void)
Complete one measurement: latch an in-window count and set MENDF.
static const board_periph_block_t s_k_cac_block
CAC block descriptor (self-registered with the core).
static RA8_INTERNAL void internal_cac_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
MMIO write inside the CAC window.
static RA8_INTERNAL void internal_cac_reset(void)
Reset the CAC model to power-on state.
cac_geom_t
CAC block geometry (ra8_cac_regs.h, r_cac_regs_t).
@ k_cac_span
Covers CACR0..CACNTBR.
@ k_cac_off_cacntbr
CACNTBR counter buffer (16b).
@ k_cac_off_cacr0
CACR0 control 0 (CFME).
@ k_cac_off_castr
CASTR status (MENDF/FERRF/OVFF).
@ k_cac_base
CAC register base (HUM Ch 10.2).
@ k_cac_off_callvr
CALLVR lower limit (16b).
@ k_cac_off_caulvr
CAULVR upper limit (16b).
@ k_cac_off_caicr
CAICR interrupt / flag-clear.
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.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
A modelled peripheral block's self-description for the core registry.
uint8_t cacr0
CACR0 shadow (CFME).
uint8_t castr
CASTR status flags.
uint32_t meas
Measurements completed (for report).
uint16_t callvr
Lower window limit.
uint16_t caulvr
Upper window limit.
uint16_t cacntbr
Latched edge count.