39typedef enum : uint32_t {
45typedef enum : uint64_t {
57typedef enum : uint32_t {
66typedef enum : uint32_t {
73typedef enum : uint32_t {
117 const uint32_t in = dodir & mask;
118 const uint32_t cur =
s_doc.dodsr0 & mask;
120 const uint32_t sum = cur + in;
122 s_doc.dodsr0 = sum & mask;
125 s_doc.dodsr0 = (cur - in) & mask;
129 const uint32_t dcsel =
131 const bool equal = (in == cur);
132 const bool hit = (dcsel == 1U) ? equal : !equal;
174 const uint64_t off = addr - (uint64_t)
k_doc_base;
207 const uint64_t off = addr - (uint64_t)
k_doc_base;
209 s_doc.docr = (uint8_t)value;
211 if (((uint8_t)value & (uint8_t)
k_doc_dopcf) != 0U) {
217 s_doc.dodsr0 = (uint32_t)value;
219 s_doc.dodsr1 = (uint32_t)value;
233 if (
s_doc.ops == 0U) {
239 (
unsigned)
s_doc.dopcf,
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.
@ k_u32_all
32-bit all-ones.
doc_field_t
DOCR / DOSR field masks (ra8_doc_regs.h).
@ k_doc_dobw_mask
DOBW: 0 = 16-bit, 1 = 32-bit.
@ k_doc_dcsel_mask
DCSEL[2:0] compare condition.
@ k_doc_dcsel_shift
DCSEL field position.
@ k_doc_dopcf
DOSR DOPCF flag / DOSCR clear.
@ k_doc_oms_mask
OMS[1:0] mode select.
doc_map_t
DOC block geometry (ra8_doc_regs.h).
@ k_doc_span
Register window.
@ k_doc_base
DOC base (HUM Ch 57.2).
@ k_doc_off_doscr
DOSCR status clear, 8b.
@ k_doc_off_docr
DOCR control (OMS/DOBW/DCSEL), 8b.
@ k_doc_off_dodsr1
DODSR1 upper threshold.
@ k_doc_off_dodsr0
DODSR0 reference / result.
@ k_doc_off_dosr
DOSR status (DOPCF), 8b.
@ k_doc_off_dodir
DODIR data input.
doc_lit_t
Result-width masks for the DOC unit (32-bit vs 16-bit mode).
@ k_u16_full
16-bit result mask.
static RA8_INTERNAL void internal_doc_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
MMIO write inside the DOC window.
doc_mode_t
DOCR.OMS operation modes.
@ k_doc_mode_compare
Compare (set DOPCF on DCSEL hit).
@ k_doc_mode_subtract
DODSR0 -= DODIR.
@ k_doc_mode_add
DODSR0 += DODIR.
static RA8_INTERNAL void internal_doc_apply(uint32_t dodir)
Apply one DODIR operand to DODSR0 per the current DOCR.OMS mode.
static RA8_INTERNAL void internal_doc_report(void)
End-of-run DOC section: mode, last result, op count.
static RA8_INTERNAL uint64_t internal_doc_read(uc_engine *uc, uint64_t addr, unsigned size)
MMIO read inside the DOC window.
static RA8_INTERNAL uint32_t internal_doc_width_mask(void)
Width mask selected by DOCR.DOBW (0 = 16-bit, 1 = 32-bit).
static RA8_INTERNAL void internal_doc_reset(void)
Reset the DOC unit to power-on state.
doc_order_t
Per-tick order slot for the DOC block (relative order only).
@ k_doc_block_order
After the CRC block; report order.
static RA8_INTERNAL void internal_doc_block_register(void)
Register the DOC block before main (host constructor).
static const board_periph_block_t s_k_doc_block
DOC block descriptor (self-registered with the core).
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 docr
DOCR shadow (OMS/DOBW/DCSEL).
uint32_t ops
Operations performed.
uint32_t dodsr0
Reference / running result.
uint8_t dopcf
DOSR.DOPCF latch.
uint32_t dodsr1
Upper threshold (compare).