61#error "npu_vela must be built with cmake/toolchain-ra8p1.cmake (RA8_DEVICE_RA8P1)."
68typedef enum : uint32_t {
82typedef enum : uint32_t {
141 __asm__
volatile(
"wfi");
163 __asm__
volatile(
"wfi");
243 for (uint32_t i = 0U; i < count; i++) {
245 if (output[i] != expected) {
297 static const uint8_t k_hex[] =
"0123456789ABCDEF";
300 const uint8_t shift =
309 const uint8_t* text = ok ? (
const uint8_t*)
"OK" : (
const uint8_t*)
"FAIL";
310 const size_t len = ok ? 2U : 4U;
316 const uint8_t* text = pass ? (
const uint8_t*)
"PASS" : (
const uint8_t*)
"FAIL";
368 bool load_ok =
false;
388 pass = load_ok && run_ok && matched && (
id != 0U);
void main(void)
Secure fallback main entry point.
static void internal_npu_vela_panic_halt(void)
Park the CPU forever in WFI after a fatal init error (a real panic).
npu_vela_fnv_t
FNV-1a 32-bit constants for the displayed output checkword.
@ k_npu_vela_fnv_prime
FNV-1a 32-bit prime.
@ k_npu_vela_fnv_offset
FNV-1a 32-bit offset basis.
static void internal_npu_vela_write(const uint8_t *data, size_t len)
static void internal_npu_vela_emit(uint32_t id, bool load_ok, bool run_ok, uint32_t check, bool pass)
Print the one-line verdict banner over the SCI8 console.
npu_vela_size_t
Console baud, runtime-arena size, banner width, and word geometry.
@ k_npu_vela_hex_digits
Fixed-width hexadecimal word digits.
@ k_npu_vela_word_bytes
Bytes in one little-endian word.
@ k_npu_vela_arena
Runtime arena for output activation.
@ k_npu_vela_baud
SCI8 J-Link OB console baud.
@ k_npu_vela_byte_mask
8-bit element wrap (matches the op).
@ k_npu_vela_hex_shift
Bits per hexadecimal nibble.
@ k_npu_vela_hex_mask
Mask for one hexadecimal nibble.
volatile uint32_t g_npu_vela_check
Output checkword captured after verify, for external inspection.
static void internal_npu_vela_write_verdict(bool pass)
volatile uint32_t g_npu_vela_pass
Final verdict (1 = PASS, 0 = FAIL), for external inspection.
static uint8_t s_npu_vela_arena[k_npu_vela_arena]
Runtime arena the loader carves the output activation from.
static uint32_t internal_npu_vela_cmd_word(const ra8_npu_job_t *job, ra8_npu_fake_word_idx_t widx)
Read a little-endian command-stream word from the loaded job.
static void internal_npu_vela_park(void)
Park the CPU forever in WFI after the verdict banner (a clean stop).
static void internal_npu_vela_write_hex32(uint32_t value)
volatile uint32_t g_npu_vela_id
NPU_ID captured after init, for external (J-Link) inspection.
static ra8_err_t internal_npu_vela_run_job(ra8_npu_job_t *out_job)
Load the golden blob, submit + run + wait for the NPU job.
static void internal_npu_vela_setup_or_halt(void)
Bring up CGC + the SCI8 console.
static bool internal_npu_vela_verify(const ra8_npu_job_t *job, uint32_t *out_check)
Verify the output arena equals input+K and fold it into a checkword.
static void internal_npu_vela_write_status(bool ok)
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
ra8_err_t ra8_board_uart_console_flush(void)
Block until every byte queued on the J-Link OB VCOM console has finished clocking out on the wire.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Compile-time device selection for the RA8 multi-chip build (RA8D2 / RA8P1).
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Arm Ethos-U55 NPU command/queue driver foundation (RA8P1-only).
ra8_err_t ra8_npu_submit(const ra8_npu_job_t *job)
Program the command queue and tensor region base pointers for a job.
ra8_err_t ra8_npu_run(void)
Kick the currently-submitted job (transition the NPU to running).
ra8_err_t ra8_npu_read_id(uint32_t *out_id)
Read the Ethos-U55 NPU_ID (architecture / product revision) register.
ra8_err_t ra8_npu_init(void)
Bring the NPU out of module-stop and soft-reset it.
ra8_err_t ra8_npu_wait(void)
Bounded busy-wait until the running job completes or faults.
.npub linkable-blob container for a Vela-compiled Ethos-U55 model
static uint32_t ra8_npu_blob_read_word(const uint8_t *buf, uint32_t byte_off)
Read one little-endian 32-bit word from a .npub byte buffer.
ra8_emulator / host-test command-stream convention for the Ethos-U55 model
ra8_npu_fake_word_idx_t
32-bit word indices of the fixed stand-in command-stream header.
@ k_ra8_npu_fake_word_count
Byte count to process.
@ k_ra8_npu_fake_word_const
Constant addend (add-constant op).
On-target loader: .npub Vela blob -> ra8_npu_job_t (RA8P1-only).
ra8_err_t ra8_npu_load(const void *blob, uint32_t blob_bytes, const ra8_npu_arena_t *arena, ra8_npu_job_t *out_job)
Validate a .npub blob and map it into an ra8_npu_job_t.
static uint32_t ra8_npu_model_addk_fake_bytes(void)
Byte length of the 'addk_fake' .npub blob.
static const uint8_t * ra8_npu_model_addk_fake_blob(void)
Base pointer of the 'addk_fake' .npub blob.
Arm Ethos-U55 NPU register window on the Renesas RA8P1 (RA8P1-only).
@ k_ra8_npu_region_2
AXI region 2.
@ k_ra8_npu_region_1
AXI region 1.
Caller-provided runtime arena for a model's RUNTIME regions.
One Ethos-U55 inference job: a command stream plus its tensor arenas.
uint64_t region_base[k_ra8_npu_region_count]
AXI base of each BASEPn arena.
const void * cmd_stream
Vela command stream base in SRAM.