46typedef enum : uint64_t {
69typedef enum : uint32_t {
76typedef enum : uint32_t {
82typedef enum : uint32_t {
88typedef enum : uint32_t {
95typedef enum : uint32_t {
103typedef enum : uint32_t {
109typedef enum : uint8_t {
127typedef enum : uint16_t {
194 return (uint32_t)(off >> 2U);
211 const uint32_t mode = gctr & (uint32_t)
k_mode_mask;
266 bool any_active =
false;
276 if ((tx_id & mask) == (accept_id & mask)) {
311 k_canfd_console_line_cap = 64U,
313 char ln[k_canfd_console_line_cap];
314 (void)snprintf(ln,
sizeof(ln),
"CANFD%u TX id=0x%X dlc=%u %s", inst, tx_id, dlc, outcome);
342 (void)
priv_emu_io_errf(
" [trace] CANFD%u loopback: TX id=0x%X filtered (no AFL match)\n",
350 c->
reg[rf + w] = c->
reg[tm + w];
362 (void)
priv_emu_io_errf(
" [trace] CANFD%u loopback: TX MB0 -> RX FIFO0 (id=0x%X)\n",
425 if (((uint8_t)value & (uint8_t)
k_tmc_txreq) != 0U) {
475 if (
s_canfd[i].loopbacks == 0U) {
Multi-channel console log store backing the board view's tabbed console.
void board_console_push(board_console_ch_t ch, const char *line)
Append one completed line to a channel ring and the ALL ring.
@ k_board_console_ch_can
CAN-FD frame summaries.
Decentralized peripheral-block registry for the board emulator core.
void board_periph_icu_raise_event(uc_engine *uc, uint16_t event)
Raise a peripheral ELC event through the core's ICU -> NVIC path.
void board_periph_register_block(const board_periph_block_t *block)
Register a peripheral block's descriptor with the core registry.
@ k_block_order_i2c
I3C/I2C + GT911 (no tick today).
bool board_periph_trace(void)
Whether –trace is active (blocks log transitions when true).
static RA8_INTERNAL uint64_t internal_canfd_offset(uint32_t inst, uint64_t addr)
In-window byte offset of addr for instance inst.
static const board_periph_block_t s_k_canfd1_block
CANFD1 register window (reset / report handled by the CANFD0 block).
canfd_rfsts_t
RX FIFO status (CFDRFSTS[0]) bit masks.
@ k_rfsts_empty
RFEMP: FIFO empty flag.
@ k_rfsts_if
RFIF: RX interrupt flag.
static RA8_INTERNAL uint32_t internal_canfd_instance(uint64_t addr)
Resolve an absolute address to its instance index (0/1) or count.
static RA8_INTERNAL void internal_canfd_apply_channel_mode(canfd_inst_t *c, uint32_t ctr)
Apply a channel mode-control write to its matching status bits.
canfd_elc_event_t
CANFD0 RX-FIFO (RXF) ELC event the model pends on loopback delivery.
@ k_event_can0_rxf
CANFD0 RXF RX-FIFO event (best-effort).
static RA8_INTERNAL void internal_canfd_report(void)
Print one line per CANFD instance that looped a frame back.
canfd_map_t
CANFD block geometry (ra8_canfd_regs.h, FSP R_CANFD_Type).
@ k_canfd_span
Full FSP R_CANFD_Type window size.
@ k_canfd_off_gsts
CFDGSTS global status.
@ k_canfd_off_tmc0
CFDTMC[0] TX MB 0 control byte.
@ k_canfd_words
CANFD words.
@ k_canfd_off_rfsts0
CFDRFSTS[0] RX FIFO 0 status.
@ k_canfd0_base
CANFD0 channel-window base.
@ k_canfd_off_tm0
CFDTM[0] TX MB 0 access window.
@ k_canfd_afl_stride
Bytes per CFDGAFL entry (ID/M/P0/P1).
@ k_canfd_off_cnctr
CFDC[0].CTR channel control.
@ k_canfd_count
CANFD0 / CANFD1.
@ k_canfd_off_gctr
CFDGCTR global control.
@ k_canfd_frame_words
ID+PTR+FDSTS+DF[64] = 19 words.
@ k_canfd_off_rfpctr0
CFDRFPCTR[0] RX FIFO 0 pointer ctrl.
@ k_canfd_off_afl
CFDGAFL[] acceptance-filter window.
@ k_canfd_off_tmsts0
CFDTMSTS[0] TX MB 0 status byte.
@ k_canfd_off_rf0
CFDRF[0] RX FIFO 0 access window.
@ k_canfd_afl_count
Entries in one CFDGAFL page window.
@ k_canfd_off_cnsts
CFDC[0].STS channel status.
@ k_canfd1_base
CANFD1 channel-window base.
canfd_gsts_t
Global status (CFDGSTS) bit masks the model drives.
@ k_gsts_graminit
Global RAM-init in progress.
@ k_gsts_ghltsts
Global halt status.
@ k_gsts_grststs
Global reset status.
static const board_periph_block_t s_k_canfd0_block
CANFD0 register window + the shared loopback reset / report.
static canfd_inst_t s_canfd[k_canfd_count]
static RA8_INTERNAL void internal_board_periph_canfd_register(void)
Self-register both CANFD windows before main runs (decentralized).
canfd_tmc_t
TX MB control / status byte bits.
@ k_tmc_txreq
CFDTMC.TMTR transmit request.
@ k_tmsts_done
CFDTMSTS.TMTRF = 10b complete.
static RA8_INTERNAL void internal_canfd_write(uc_engine *uc, uint64_t addr, unsigned size, uint64_t value)
Handle a write to a CANFD register with side effects, else latch it.
static RA8_INTERNAL void internal_canfd_apply_global_mode(canfd_inst_t *c, uint32_t gctr)
Apply a mode-control write to its matching status register bits.
static RA8_INTERNAL void internal_canfd_console_frame(uint32_t inst, uint32_t tx_id, uint32_t dlc, const char *outcome)
Push a one-line CAN-FD frame summary to the board console CAN lane.
static RA8_INTERNAL uint64_t internal_canfd_read(uc_engine *uc, uint64_t addr, unsigned size)
MMIO read inside a CANFD window: read back the latched register.
canfd_id_mask_t
Message-ID field masks (CFDRF.ID / CFDTM.ID), for trace + report.
@ k_canfd_id_std
11-bit standard ID.
@ k_canfd_id_ext
29-bit extended ID.
canfd_cnsts_t
Channel status (CFDC[0].STS) bit masks the model drives.
@ k_cnsts_chltst
Channel halt status.
@ k_cnsts_crstst
Channel reset status.
canfd_ptr_t
CFDTM/CFDRF.PTR frame fields (PTR layout: [15:0] timestamp, [31:28] DLC).
@ k_canfd_ptr_word
PTR is the 2nd word of a frame window.
@ k_canfd_ptr_dlc_shift
DLC occupies PTR bits [31:28].
@ k_canfd_ptr_dlc_mask
4-bit DLC code mask (0..15).
static RA8_INTERNAL uint32_t internal_canfd_word(uint64_t off)
Word index into the backing store for an in-window offset.
canfd_mode_t
Global / channel mode-control field (GMDC / CHMDC, bits [1:0]).
@ k_mode_operation
Operation mode.
@ k_mode_mask
2-bit mode field.
@ k_mode_reset
Reset mode.
static RA8_INTERNAL bool internal_canfd_frame_accepted(const canfd_inst_t *c, uint32_t tx_id)
Decide whether tx_id passes the programmed acceptance filter.
static RA8_INTERNAL void internal_canfd_loopback_deliver(uc_engine *uc, uint32_t inst)
Copy TX MB 0 into RX FIFO 0 and flag the frame available.
static RA8_INTERNAL void internal_canfd_reset(void)
Reset both CANFD instances to a coherent power-on state.
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).
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
A modelled peripheral block's self-description for the core registry.
One CANFD instance: flat register backing store.
uint32_t reg[k_canfd_words]
Word-addressed register backing.
uint32_t loopbacks
Frames delivered TX -> RX FIFO.