ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
main.c File Reference

Drives each ra8_mem (#147) memory-hierarchy layer in isolation (#263). More...

#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "ra8_arena.h"
#include "ra8_board_ek_ra8d2.h"
#include "ra8_boot_entry.h"
#include "ra8_cgc.h"
#include "ra8_err.h"
#include "ra8_isr.h"
#include "ra8_mstp.h"
#include "ra8_slab.h"
#include "ra8_tile_cache.h"
#include "ra8_time.h"
#include "ra8_vmem_stream.h"
#include "ra8_vsource.h"
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  mem_report_t
 Observables gathered from the four exercises. More...

Enumerations

enum  mem_console_t : uint32_t {
  k_mem_uart_baud = 115200U ,
  k_mem_crc_init = 0xFFFFFFFFU ,
  k_mem_crc_xorout = 0xFFFFFFFFU ,
  k_mem_crc_poly = 0xEDB88320U ,
  k_mem_crc_bits = 8U ,
  k_mem_hex_nibbles = 8U ,
  k_mem_nibble_bits = 4U ,
  k_mem_nibble_mask = 0x0FU ,
  k_mem_dec_base = 10U
}
 Console + banner-format knobs (no magic numbers). More...
enum  mem_slab_cfg_t : uint32_t {
  k_mem_slab_pool_bytes = 512U ,
  k_mem_slab_cell_bytes = 64U ,
  k_mem_slab_cells = 8U ,
  k_mem_slab_freed = 3U
}
 Slab-exercise sizing. More...
enum  mem_arena_cfg_t : uint32_t {
  k_mem_arena_pool_bytes = 4096U ,
  k_mem_arena_carve0 = 1000U ,
  k_mem_arena_carve1 = 2000U ,
  k_mem_arena_big = 2000U ,
  k_mem_arena_align0 = 8U ,
  k_mem_arena_align1 = 16U
}
 Arena-exercise sizing. More...
enum  mem_tile_cfg_t : uint32_t {
  k_mem_tile_cell_bytes = 64U ,
  k_mem_tile_cells = 4U ,
  k_mem_tile_buckets = 8U ,
  k_mem_tile_distinct = 8U ,
  k_mem_tile_exp_hits = 4U ,
  k_mem_tile_exp_miss = 9U ,
  k_mem_tile_exp_evict = 5U
}
 Tile-cache-exercise sizing + expected counters. More...
enum  mem_tile_dim_t : uint16_t { k_mem_tile_dim = 16U }
 Synthetic decoded-tile dimensions. More...
enum  mem_vmem_cfg_t : uint32_t {
  k_mem_vmem_frame_bytes = 512U ,
  k_mem_vmem_frames = 4U ,
  k_mem_vmem_buckets = 8U ,
  k_mem_vmem_objs = 1U ,
  k_mem_vmem_obj_bytes = 1048576U ,
  k_mem_win_buf_bytes = 1024U ,
  k_mem_win0_off = 0U ,
  k_mem_win0_len = 100U ,
  k_mem_win1_off = 500U ,
  k_mem_win1_len = 100U ,
  k_mem_win2_off = 1000U ,
  k_mem_win2_len = 1000U ,
  k_mem_win_eof_back = 50U ,
  k_mem_win_eof_len = 100U ,
  k_mem_win_past_len = 10U
}
 vmem_stream-exercise sizing + read windows. More...
enum  mem_gen_t : uint32_t {
  k_mem_gen_mul = 0x9E3779B1U ,
  k_mem_gen_add = 0x00A5A5A5U ,
  k_mem_gen_shift_a = 5U ,
  k_mem_gen_shift_b = 13U ,
  k_mem_gen_shift_out = 24U
}
 Deterministic backing-byte generator constants. More...

Functions

static void mem_print (const uint8_t *msg, uint32_t len)
 Emit a byte run on the board console.
static void mem_panic_halt (const uint8_t *msg, uint32_t len)
 Print the fail banner and trap (ra8_emulator halts on the BKPT).
static uint32_t mem_crc32_byte (uint32_t crc, uint8_t b)
 Fold one byte into a running CRC-32 (reflected, poly 0xEDB88320).
static uint8_t mem_gen_byte (uint64_t off)
 Deterministic backing byte at absolute off (host/emulator/silicon-equal).
static void mem_print_hex (uint32_t value)
 Print a 32-bit value as 8 upper-case hex digits.
static void mem_print_uint (uint32_t value)
 Print a small unsigned integer in decimal.
static bool mem_run_slab (mem_report_t *r)
 Exercise 1: slab alloc-to-exhaustion, free, and reset-by-reinit.
static bool mem_run_arena (mem_report_t *r)
 Exercise 2: arena bump carves, over-subscription, and reset-by-reinit.
static ra8_err_t mem_tile_decode (void *ctx, const ra8_tile_key_t *key, uint8_t *cell, uint32_t cell_bytes, uint16_t *out_w, uint16_t *out_h)
 Synthetic tile decoder: stamps the key column into the cell.
static ra8_err_t mem_tile_touch (ra8_tile_cache_t *tc, uint16_t tx)
 Fetch (get + immediately put) tile column tx, so it is unpinned.
static bool mem_run_tiles (mem_report_t *r)
 Exercise 3: overfill the tile cache to observe LRU eviction.
static ra8_err_t mem_backing_read (void *ctx, uint64_t offset, uint8_t *buf, uint32_t len)
 Backing read callback: fill buf with the deterministic generator.
static bool mem_stream_window (ra8_vmem_stream_t *st, uint64_t off, uint32_t len, uint32_t *crc, size_t *out_got)
 Read one byte window through the stream, verify it, and fold it in.
static bool mem_vmem_read_windows (ra8_vmem_stream_t *st, uint32_t *crc)
 Read every window and confirm the stream returned the expected lengths.
static bool mem_run_vmem (mem_report_t *r)
 Exercise 4: stream byte windows out of a 1 MiB object via a 2 KiB cache.
static void mem_setup_or_halt (void)
 Bring up clocks / MSTP / time + the board console; halt on failure.
void main (void)
 App entry: drive each ra8_mem layer, then print the observables banner.

Variables

static uint8_t s_slab_pool [k_mem_slab_pool_bytes]
 Slab-exercise pool.
static uint8_t s_arena_pool [k_mem_arena_pool_bytes]
 Arena-exercise region.
static uint8_t s_tile_cells [(size_t) k_mem_tile_cells *(size_t) k_mem_tile_cell_bytes]
 Tile-cache decoded-pixel cells.
static ra8_tile_key_t s_tile_keys [k_mem_tile_cells]
 Tile-cache per-cell key storage.
static ra8_tile_dims_t s_tile_dims [k_mem_tile_cells]
 Tile-cache per-cell dimension descriptors.
static ra8_keycache_cell_t s_tile_meta [k_mem_tile_cells]
 Tile-cache per-cell link metadata.
static int32_t s_tile_buckets [k_mem_tile_buckets]
 Tile-cache hash buckets.
static uint8_t s_vmem_frames [(size_t) k_mem_vmem_frames *(size_t) k_mem_vmem_frame_bytes]
 Page-cache frame storage (2 KiB resident).
static ra8_vmem_frame_t s_vmem_fmeta [k_mem_vmem_frames]
 Page-cache per-frame metadata.
static ra8_vmem_key_t s_vmem_fkeys [k_mem_vmem_frames]
 Page-cache per-frame key storage.
static int32_t s_vmem_fbuckets [k_mem_vmem_buckets]
 Page-cache hash buckets.
static ra8_vsource_obj_t s_vmem_objs [k_mem_vmem_objs]
 Object-source registry slots.
static uint8_t s_win_buf [k_mem_win_buf_bytes]
 Stream read scratch (>= the widest window).
static const uint8_t k_msg_boot [] = "mem-subsystem: boot 2KiB-resident-1MiB-paged\r\n"
static const uint8_t k_msg_fail_init [] = "mem: FAIL init\r\n"
static const uint8_t k_msg_fail_slab [] = "mem: FAIL slab\r\n"
static const uint8_t k_msg_fail_arena [] = "mem: FAIL arena\r\n"
static const uint8_t k_msg_fail_tile [] = "mem: FAIL tile\r\n"
static const uint8_t k_msg_fail_vmem [] = "mem: FAIL vmem\r\n"
static const uint8_t k_msg_slab [] = "mem: slab_free="
static const uint8_t k_msg_arena [] = " arena_free="
static const uint8_t k_msg_tile [] = " tile_evict="
static const uint8_t k_msg_vmem [] = " vmem_crc="
static const uint8_t k_msg_ok [] = " PASS\r\n"

Detailed Description

Drives each ra8_mem (#147) memory-hierarchy layer in isolation (#263).

The #147 memory primitives (ra8_slab, ra8_arena, ra8_tile_cache, and the ra8_vmem / ra8_vsource / ra8_vmem_stream page cache) are exercised inside the e-reader but had no direct example. This app drives each one on its own so the behaviour is observable without the whole reader stack:

  1. Slab (Layer 0) – carve a fixed pool into equal cells, allocate every cell (the next allocation fails), free a few, then reset by re-init and confirm every cell is free again.
  2. Arena (Layer 0) – bump two aligned sub-blocks out of one region, prove an over-subscribed carve fails, then reset by re-init and confirm the whole region is available again.
  3. Tile cache (Layer 3b) – fault more distinct tiles through the cache than it has cells so LRU eviction is forced, then observe the hit / miss / eviction counters.
  4. vmem_stream (Layer 2 helper) – front a 1 MiB synthetic backing object with a fixed 4-frame page cache and read back several byte windows (some crossing frame boundaries, one clamped at EOF, one fully past EOF), verifying every byte and folding them into a CRC-32 fingerprint. The resident set stays 2 KiB while the object is 1 MiB – paging, not residency.

The console banner is:

mem: slab_free=8 arena_free=4096 tile_evict=5 vmem_crc=<8hex> PASS

Every value is computed by the deterministic ra8_mem library from fixed inputs with no MMIO, so the banner is byte-identical on the host unit test (tests/mocks/src/test_app_mem_subsystem.c), ra8_emulator, and silicon. Any failure on any layer prints a FAIL banner and traps on a BKPT before the PASS line, so the EIL / HIL gate is exact.

[Ring 7 / App] {World: NS}

Since
0.1.0

Definition in file main.c.

Enumeration Type Documentation

◆ mem_arena_cfg_t

enum mem_arena_cfg_t : uint32_t

Arena-exercise sizing.

Enumerator
k_mem_arena_pool_bytes 

Backing region size.

k_mem_arena_carve0 

First carve size.

k_mem_arena_carve1 

Second carve size.

k_mem_arena_big 

Over-subscribed carve (must fail).

k_mem_arena_align0 

First / big carve alignment.

k_mem_arena_align1 

Second carve alignment.

Definition at line 83 of file main.c.

◆ mem_console_t

enum mem_console_t : uint32_t

Console + banner-format knobs (no magic numbers).

Enumerator
k_mem_uart_baud 

Console baud.

k_mem_crc_init 

CRC-32 initial value.

k_mem_crc_xorout 

CRC-32 final xor (== bitwise not).

k_mem_crc_poly 

CRC-32 reflected polynomial.

k_mem_crc_bits 

Bits folded per byte.

k_mem_hex_nibbles 

Hex digits in a 32-bit value.

k_mem_nibble_bits 

Bits per hex nibble.

k_mem_nibble_mask 

Low-nibble mask.

k_mem_dec_base 

Decimal base / hex-digit split.

Definition at line 62 of file main.c.

◆ mem_gen_t

enum mem_gen_t : uint32_t

Deterministic backing-byte generator constants.

Enumerator
k_mem_gen_mul 

Odd multiplicative mixer.

k_mem_gen_add 

Additive constant.

k_mem_gen_shift_a 

First xor-fold shift.

k_mem_gen_shift_b 

Second xor-fold shift.

k_mem_gen_shift_out 

Output byte select shift.

Definition at line 128 of file main.c.

◆ mem_slab_cfg_t

enum mem_slab_cfg_t : uint32_t

Slab-exercise sizing.

Enumerator
k_mem_slab_pool_bytes 

Backing pool size.

k_mem_slab_cell_bytes 

Bytes per cell (512/64 = 8).

k_mem_slab_cells 

Cells the pool divides into.

k_mem_slab_freed 

Cells freed before the reset.

Definition at line 75 of file main.c.

◆ mem_tile_cfg_t

enum mem_tile_cfg_t : uint32_t

Tile-cache-exercise sizing + expected counters.

Enumerator
k_mem_tile_cell_bytes 

Bytes per tile cell.

k_mem_tile_cells 

Cells in the cache.

k_mem_tile_buckets 

Hash buckets.

k_mem_tile_distinct 

Distinct tiles faulted (> cells).

k_mem_tile_exp_hits 

Expected hits after the drive.

k_mem_tile_exp_miss 

Expected misses after the drive.

k_mem_tile_exp_evict 

Expected evictions after the drive.

Definition at line 93 of file main.c.

◆ mem_tile_dim_t

enum mem_tile_dim_t : uint16_t

Synthetic decoded-tile dimensions.

Enumerator
k_mem_tile_dim 

Synthetic decoded tile edge length.

Definition at line 104 of file main.c.

◆ mem_vmem_cfg_t

enum mem_vmem_cfg_t : uint32_t

vmem_stream-exercise sizing + read windows.

Enumerator
k_mem_vmem_frame_bytes 

Page-cache frame size.

k_mem_vmem_frames 

Frames in the fixed pool (2 KiB resident).

k_mem_vmem_buckets 

Page-cache hash buckets.

k_mem_vmem_objs 

Registry slots.

k_mem_vmem_obj_bytes 

Synthetic backing object size (1 MiB).

k_mem_win_buf_bytes 

Read scratch (>= the widest window).

k_mem_win0_off 

Window 0 offset (within frame 0).

k_mem_win0_len 

Window 0 length.

k_mem_win1_off 

Window 1 offset (crosses frame boundary).

k_mem_win1_len 

Window 1 length.

k_mem_win2_off 

Window 2 offset (spans several frames).

k_mem_win2_len 

Window 2 length.

k_mem_win_eof_back 

Bytes before EOF the near-EOF window starts.

k_mem_win_eof_len 

Near-EOF window length (clamps to 50).

k_mem_win_past_len 

Past-EOF window length (reads 0).

Definition at line 109 of file main.c.

Function Documentation

◆ main()

void main ( void )

App entry: drive each ra8_mem layer, then print the observables banner.

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
The slab/arena/tile/vmem banner is emitted; the CPU then loops in WFI.
Since
0.1.0

Definition at line 582 of file main.c.

References mem_report_t::arena_free, k_msg_arena, k_msg_boot, k_msg_fail_arena, k_msg_fail_slab, k_msg_fail_tile, k_msg_fail_vmem, k_msg_ok, k_msg_slab, k_msg_tile, k_msg_vmem, mem_panic_halt(), mem_print(), mem_print_hex(), mem_print_uint(), mem_run_arena(), mem_run_slab(), mem_run_tiles(), mem_run_vmem(), mem_setup_or_halt(), ra8_isr_globals_enable(), mem_report_t::slab_free, mem_report_t::tile_evictions, and mem_report_t::vmem_crc.

◆ mem_backing_read()

ra8_err_t mem_backing_read ( void * ctx,
uint64_t offset,
uint8_t * buf,
uint32_t len )
static

Backing read callback: fill buf with the deterministic generator.

Definition at line 427 of file main.c.

References k_ra8_err_null_ptr, k_ra8_ok, and mem_gen_byte().

Referenced by mem_run_vmem().

◆ mem_crc32_byte()

uint32_t mem_crc32_byte ( uint32_t crc,
uint8_t b )
static

Fold one byte into a running CRC-32 (reflected, poly 0xEDB88320).

Definition at line 210 of file main.c.

References k_mem_crc_bits, and k_mem_crc_poly.

Referenced by mem_stream_window().

◆ mem_gen_byte()

uint8_t mem_gen_byte ( uint64_t off)
static

Deterministic backing byte at absolute off (host/emulator/silicon-equal).

Definition at line 221 of file main.c.

References k_mem_gen_add, k_mem_gen_mul, k_mem_gen_shift_a, k_mem_gen_shift_b, and k_mem_gen_shift_out.

Referenced by mem_backing_read(), and mem_stream_window().

◆ mem_panic_halt()

void mem_panic_halt ( const uint8_t * msg,
uint32_t len )
static

Print the fail banner and trap (ra8_emulator halts on the BKPT).

Definition at line 200 of file main.c.

References mem_print().

Referenced by main(), and mem_setup_or_halt().

◆ mem_print()

void mem_print ( const uint8_t * msg,
uint32_t len )
static

Emit a byte run on the board console.

Definition at line 194 of file main.c.

References ra8_board_uart_console_write().

Referenced by main(), mem_panic_halt(), mem_print_hex(), and mem_print_uint().

◆ mem_print_hex()

void mem_print_hex ( uint32_t value)
static

Print a 32-bit value as 8 upper-case hex digits.

Definition at line 230 of file main.c.

References k_mem_dec_base, k_mem_hex_nibbles, k_mem_nibble_bits, k_mem_nibble_mask, and mem_print().

Referenced by main().

◆ mem_print_uint()

void mem_print_uint ( uint32_t value)
static

Print a small unsigned integer in decimal.

Definition at line 243 of file main.c.

References k_mem_dec_base, and mem_print().

Referenced by main().

◆ mem_run_arena()

bool mem_run_arena ( mem_report_t * r)
static

Exercise 2: arena bump carves, over-subscription, and reset-by-reinit.

Parameters
[out]rReport to update with the bytes remaining after the reset.
Returns
true on the expected behaviour, false on any deviation.

Definition at line 316 of file main.c.

References mem_report_t::arena_free, k_mem_arena_align0, k_mem_arena_align1, k_mem_arena_big, k_mem_arena_carve0, k_mem_arena_carve1, k_mem_arena_pool_bytes, k_ra8_err_no_mem, k_ra8_ok, ra8_arena_carve(), ra8_arena_init(), ra8_arena_remaining(), and s_arena_pool.

Referenced by main().

◆ mem_run_slab()

bool mem_run_slab ( mem_report_t * r)
static

Exercise 1: slab alloc-to-exhaustion, free, and reset-by-reinit.

Parameters
[out]rReport to update with the free-cell count after the reset.
Returns
true on the expected behaviour, false on any deviation.

Definition at line 267 of file main.c.

References k_mem_slab_cell_bytes, k_mem_slab_cells, k_mem_slab_freed, k_ra8_err_no_mem, k_ra8_ok, ra8_slab_alloc(), ra8_slab_free(), ra8_slab_init(), ra8_slab_stats(), s_slab_pool, and mem_report_t::slab_free.

Referenced by main().

◆ mem_run_tiles()

bool mem_run_tiles ( mem_report_t * r)
static

Exercise 3: overfill the tile cache to observe LRU eviction.

Parameters
[out]rReport to update with the hit / miss / eviction counters.
Returns
true on the expected counters, false on any deviation.

Definition at line 382 of file main.c.

References k_mem_tile_buckets, k_mem_tile_cell_bytes, k_mem_tile_cells, k_mem_tile_distinct, k_mem_tile_exp_evict, k_mem_tile_exp_hits, k_mem_tile_exp_miss, k_ra8_ok, mem_tile_decode(), mem_tile_touch(), ra8_tile_cache_init(), ra8_tile_cache_stats(), s_tile_buckets, s_tile_cells, s_tile_dims, s_tile_keys, s_tile_meta, mem_report_t::tile_evictions, mem_report_t::tile_hits, and mem_report_t::tile_misses.

Referenced by main().

◆ mem_run_vmem()

bool mem_run_vmem ( mem_report_t * r)
static

Exercise 4: stream byte windows out of a 1 MiB object via a 2 KiB cache.

Parameters
[out]rReport to update with the window CRC + page-cache evictions.
Returns
true on the expected reads (and that paging occurred), false otherwise.

Definition at line 510 of file main.c.

References k_mem_crc_init, k_mem_crc_xorout, k_mem_vmem_buckets, k_mem_vmem_frame_bytes, k_mem_vmem_frames, k_mem_vmem_obj_bytes, k_mem_vmem_objs, k_ra8_ok, mem_backing_read(), mem_vmem_read_windows(), ra8_vmem_init(), ra8_vmem_stats(), ra8_vmem_stream_init(), ra8_vsource_add_paged(), ra8_vsource_init(), ra8_vsource_loader(), s_vmem_fbuckets, s_vmem_fkeys, s_vmem_fmeta, s_vmem_frames, s_vmem_objs, mem_report_t::vmem_crc, and mem_report_t::vmem_evictions.

Referenced by main().

◆ mem_setup_or_halt()

void mem_setup_or_halt ( void )
static

Bring up clocks / MSTP / time + the board console; halt on failure.

Definition at line 557 of file main.c.

References k_mem_uart_baud, k_msg_fail_init, k_ra8_clock_id_cpuclk0, k_ra8_ok, mem_panic_halt(), ra8_board_uart_console_init(), ra8_cgc_get_clock_hz(), ra8_cgc_init(), ra8_mstp_init(), and ra8_time_init().

Referenced by main().

◆ mem_stream_window()

bool mem_stream_window ( ra8_vmem_stream_t * st,
uint64_t off,
uint32_t len,
uint32_t * crc,
size_t * out_got )
static

Read one byte window through the stream, verify it, and fold it in.

Parameters
[in]stBound vmem stream.
[in]offAbsolute object offset to read from.
[in]lenBytes requested.
[in,out]crcRunning CRC-32 the read bytes are folded into.
[out]out_gotBytes the stream actually returned.
Returns
true if every returned byte matched the generator, false otherwise.

Definition at line 450 of file main.c.

References k_mem_win_buf_bytes, mem_crc32_byte(), mem_gen_byte(), ra8_vmem_stream_read(), and s_win_buf.

Referenced by mem_vmem_read_windows().

◆ mem_tile_decode()

ra8_err_t mem_tile_decode ( void * ctx,
const ra8_tile_key_t * key,
uint8_t * cell,
uint32_t cell_bytes,
uint16_t * out_w,
uint16_t * out_h )
static

Synthetic tile decoder: stamps the key column into the cell.

Definition at line 348 of file main.c.

References k_mem_tile_dim, k_ra8_ok, memset(), and ra8_tile_key_t::tile_x.

Referenced by mem_run_tiles().

◆ mem_tile_touch()

ra8_err_t mem_tile_touch ( ra8_tile_cache_t * tc,
uint16_t tx )
static

Fetch (get + immediately put) tile column tx, so it is unpinned.

Definition at line 364 of file main.c.

References k_ra8_ok, ra8_tile_t::pixels, ra8_tile_cache_get(), ra8_tile_cache_put(), and ra8_tile_key_t::tile_x.

Referenced by mem_run_tiles().

◆ mem_vmem_read_windows()

bool mem_vmem_read_windows ( ra8_vmem_stream_t * st,
uint32_t * crc )
static

Read every window and confirm the stream returned the expected lengths.

Parameters
[in]stBound vmem stream.
[in,out]crcRunning CRC-32 the read bytes are folded into.
Returns
true if every window read its expected (clamped) length correctly.

Definition at line 473 of file main.c.

References k_mem_vmem_obj_bytes, k_mem_win0_len, k_mem_win0_off, k_mem_win1_len, k_mem_win1_off, k_mem_win2_len, k_mem_win2_off, k_mem_win_eof_back, k_mem_win_eof_len, k_mem_win_past_len, and mem_stream_window().

Referenced by mem_run_vmem().

Variable Documentation

◆ k_msg_arena

const uint8_t k_msg_arena[] = " arena_free="
static

Definition at line 188 of file main.c.

Referenced by main().

◆ k_msg_boot

const uint8_t k_msg_boot[] = "mem-subsystem: boot 2KiB-resident-1MiB-paged\r\n"
static

Definition at line 181 of file main.c.

◆ k_msg_fail_arena

const uint8_t k_msg_fail_arena[] = "mem: FAIL arena\r\n"
static

Definition at line 184 of file main.c.

Referenced by main().

◆ k_msg_fail_init

const uint8_t k_msg_fail_init[] = "mem: FAIL init\r\n"
static

Definition at line 182 of file main.c.

Referenced by mem_setup_or_halt().

◆ k_msg_fail_slab

const uint8_t k_msg_fail_slab[] = "mem: FAIL slab\r\n"
static

Definition at line 183 of file main.c.

Referenced by main().

◆ k_msg_fail_tile

const uint8_t k_msg_fail_tile[] = "mem: FAIL tile\r\n"
static

Definition at line 185 of file main.c.

Referenced by main().

◆ k_msg_fail_vmem

const uint8_t k_msg_fail_vmem[] = "mem: FAIL vmem\r\n"
static

Definition at line 186 of file main.c.

Referenced by main().

◆ k_msg_ok

const uint8_t k_msg_ok[] = " PASS\r\n"
static

Definition at line 191 of file main.c.

◆ k_msg_slab

const uint8_t k_msg_slab[] = "mem: slab_free="
static

Definition at line 187 of file main.c.

Referenced by main().

◆ k_msg_tile

const uint8_t k_msg_tile[] = " tile_evict="
static

Definition at line 189 of file main.c.

Referenced by ez_print_banner(), and main().

◆ k_msg_vmem

const uint8_t k_msg_vmem[] = " vmem_crc="
static

Definition at line 190 of file main.c.

Referenced by main().

◆ s_arena_pool

uint8_t s_arena_pool[k_mem_arena_pool_bytes]
static

Arena-exercise region.

Definition at line 155 of file main.c.

Referenced by mem_run_arena().

◆ s_slab_pool

uint8_t s_slab_pool[k_mem_slab_pool_bytes]
static

Slab-exercise pool.

Definition at line 153 of file main.c.

Referenced by mem_run_slab().

◆ s_tile_buckets

int32_t s_tile_buckets[k_mem_tile_buckets]
static

Tile-cache hash buckets.

Definition at line 166 of file main.c.

Referenced by mem_run_tiles().

◆ s_tile_cells

uint8_t s_tile_cells[(size_t) k_mem_tile_cells *(size_t) k_mem_tile_cell_bytes]
static

Tile-cache decoded-pixel cells.

Definition at line 158 of file main.c.

Referenced by mem_run_tiles().

◆ s_tile_dims

ra8_tile_dims_t s_tile_dims[k_mem_tile_cells]
static

Tile-cache per-cell dimension descriptors.

Definition at line 162 of file main.c.

Referenced by mem_run_tiles().

◆ s_tile_keys

ra8_tile_key_t s_tile_keys[k_mem_tile_cells]
static

Tile-cache per-cell key storage.

Definition at line 160 of file main.c.

Referenced by mem_run_tiles().

◆ s_tile_meta

Tile-cache per-cell link metadata.

Definition at line 164 of file main.c.

Referenced by mem_run_tiles().

◆ s_vmem_fbuckets

int32_t s_vmem_fbuckets[k_mem_vmem_buckets]
static

Page-cache hash buckets.

Definition at line 175 of file main.c.

Referenced by mem_run_vmem().

◆ s_vmem_fkeys

ra8_vmem_key_t s_vmem_fkeys[k_mem_vmem_frames]
static

Page-cache per-frame key storage.

Definition at line 173 of file main.c.

Referenced by mem_run_vmem().

◆ s_vmem_fmeta

ra8_vmem_frame_t s_vmem_fmeta[k_mem_vmem_frames]
static

Page-cache per-frame metadata.

Definition at line 171 of file main.c.

Referenced by mem_run_vmem().

◆ s_vmem_frames

uint8_t s_vmem_frames[(size_t) k_mem_vmem_frames *(size_t) k_mem_vmem_frame_bytes]
static

Page-cache frame storage (2 KiB resident).

Definition at line 169 of file main.c.

Referenced by mem_run_vmem().

◆ s_vmem_objs

ra8_vsource_obj_t s_vmem_objs[k_mem_vmem_objs]
static

Object-source registry slots.

Definition at line 177 of file main.c.

Referenced by mem_run_vmem().

◆ s_win_buf

uint8_t s_win_buf[k_mem_win_buf_bytes]
static

Stream read scratch (>= the widest window).

Definition at line 179 of file main.c.

Referenced by mem_stream_window().