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

#147/#162/#164 glyph-cache workload sweep: drive the real ra8_glyph_atlas with a realistic text-render glyph stream and report the hit rate (and rasterisations saved) versus the cache budget. More...

#include <signal.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include "ra8_attributes.h"
#include "ra8_err.h"
#include "ra8_glyph_atlas.h"
#include "ra8_io_stream.h"
#include "ra8_io_stream_posix.h"
#include "ra8_keycache.h"
#include "ra8_log.h"
Include dependency graph for glyph_bench.c:

Go to the source code of this file.

Data Structures

struct  gb_workspace_t
 Exact caller-owned backing for the largest measured atlas. More...

Enumerations

enum  gb_dim_t : uint32_t {
  k_gb_pages = 200U ,
  k_gb_page_glyphs = 1800U ,
  k_gb_reread_pages = 3U ,
  k_gb_body_px = 24U ,
  k_gb_heading_px = 36U ,
  k_gb_heading_pct = 3U ,
  k_gb_cap_pct = 8U ,
  k_gb_punct_pct = 6U ,
  k_gb_digit_pct = 2U ,
  k_gb_pct_base = 100U ,
  k_gb_cell_bytes = 64U ,
  k_gb_buckets = 512U ,
  k_gb_prod_cell_kib = 36U ,
  k_gb_max_budget = 256U ,
  k_gb_decimal_scale = 100U ,
  k_gb_dec_radix = 10U ,
  k_gb_budget_width = 5U ,
  k_gb_ram_width = 12U ,
  k_gb_hit_width = 7U ,
  k_gb_raster_width = 14U
}
 Workload model dimensions (no bare literals). More...
enum  gb_const_t : uint32_t {
  k_gb_xs_a = 13U ,
  k_gb_xs_b = 7U ,
  k_gb_xs_c = 17U ,
  k_gb_ascii_az_a = 97U ,
  k_gb_ascii_az_z = 26U ,
  k_gb_case_delta = 32U ,
  k_gb_ascii_0 = 48U ,
  k_gb_digits = 10U
}
 xorshift64 + fill constants. More...
enum  gb_seed_t : uint64_t { k_gb_seed = 0xD1B54A32D192ED03ULL }
 Deterministic xorshift64 seed. More...
enum  gb_freq_t : uint32_t { k_gb_freq_total = 9999U }
 Sum of s_gb_letter_freq (the selection range). More...

Functions

static ra8_err_t internal_write_parts (ra8_io_stream_t *stream, const char *const *parts, size_t count)
 Write a fixed sequence of NUL-terminated fragments exactly.
static void internal_log_byte (void *context, uint8_t byte)
 Forward one logger byte into the bound diagnostic stream.
static ra8_err_t internal_output_init (void)
 Bind process output descriptors and make broken pipes observable.
static uint64_t internal_gb_rng (uint64_t *s)
 Advance a fixed-seed xorshift64 generator and return the new state.
static uint32_t internal_gb_below (uint64_t *s, uint32_t span)
 Draw a uniform pseudo-random integer in [0, span).
static uint32_t internal_gb_pick_letter (uint64_t *s)
 Pick a lowercase letter codepoint weighted by English frequency.
static uint32_t internal_gb_pick_codepoint (uint64_t *s)
 Choose one codepoint for the glyph stream from the weighted mix.
static ra8_err_t internal_gb_render (void *ctx, const ra8_glyph_key_t *key, uint8_t *cell, uint32_t cell_bytes, uint16_t *out_w, uint16_t *out_h)
 Atlas render-on-miss callback: stand in for one rasterisation.
static ra8_err_t internal_submit_access (ra8_glyph_atlas_t *atlas, uint64_t *rng)
 Generate and submit one deterministic glyph access.
static ra8_err_t internal_replay_page_glyphs (ra8_glyph_atlas_t *atlas, uint64_t *page_rng)
 Replay one page's fixed glyph-access sequence against a running RNG.
static ra8_err_t internal_replay_workload (ra8_glyph_atlas_t *atlas)
 Regenerate and replay the exact legacy session without a trace buffer.
static ra8_err_t internal_run_budget (uint32_t budget, uint32_t *out_hits, uint32_t *out_rasters)
 Execute one budget against the caller-visible fixed atlas backing.
static ra8_err_t internal_put_padded_u64 (ra8_io_stream_t *stream, uint64_t value, uint32_t width)
 Write one unsigned value left-padded to a fixed field width.
static ra8_err_t internal_report_header (void)
 Write the fixed report preamble and workload dimensions.
static ra8_err_t internal_report_row (uint32_t budget, uint32_t hits, uint32_t rasters)
 Write one exact table row from integer hit/miss evidence.
static ra8_err_t internal_run_report (void)
 Run the complete deterministic cache-budget report.
int main (void)
 The application entry point Reset_Handler hands control to.

Variables

static const uint32_t s_gb_budgets []
 Swept cache budgets (cell counts).
static const uint16_t s_gb_letter_freq [26]
 English letter relative frequencies, scaled to a per-mille-ish table indexed by letter (a..z).
static gb_workspace_t s_gb_workspace
 Process-lifetime semantic backing for one measured atlas.
static ra8_io_stream_t s_gb_output
 Borrowed stdout/stderr portable stream handles.
static ra8_io_stream_t s_gb_diagnostic
static ra8_io_stream_posix_state_t s_gb_output_posix
 Raw-descriptor adapter states for the borrowed process streams.
static ra8_io_stream_posix_state_t s_gb_diagnostic_posix
static const uint32_t s_gb_punct [] = {' ', '.', ',', ';', ':', '\'', '"', '-', '!', '?'}
 A small punctuation/space repertoire (codepoints).
static const uint64_t s_gb_access_total
 Total glyph accesses in the deterministic session.

Detailed Description

#147/#162/#164 glyph-cache workload sweep: drive the real ra8_glyph_atlas with a realistic text-render glyph stream and report the hit rate (and rasterisations saved) versus the cache budget.

HOST tool (not firmware). The Layer-3 glyph atlas earns its keep when the renderer stops re-rasterising glyphs it just drew; this sweep quantifies that on a realistic page-render workload so #164 can size the cell budget. It models reading a book: each page draws a stream of glyphs from an English letter-frequency distribution (plus spaces, capitals, punctuation, digits) at a body font size with occasional headings, and page-turns re-render the same working set. The stream is replayed through the ACTUAL ra8_glyph_atlas at a range of budgets (cell counts); for each it reports the hit rate and the number of render-on-miss calls (= rasterisations the renderer would actually perform).

Cache hit/miss/eviction depends only on the key stream and the budget, not on the bitmap content, so the render callback is a cheap deterministic stub – the measured hit rate is exact. Each cell in production is sized to the largest glyph bitmap (2 * max font px squared, ~36 KiB), so the RAM cost of a budget is cells * ~36 KiB; the table prints that so the knee is easy to read.

[Ring 7 / Tooling] {World: NS}

Since
0.1.0

Definition in file glyph_bench.c.

Enumeration Type Documentation

◆ gb_const_t

enum gb_const_t : uint32_t

xorshift64 + fill constants.

Enumerator
k_gb_xs_a 

xorshift shift 1.

k_gb_xs_b 

xorshift shift 2.

k_gb_xs_c 

xorshift shift 3.

k_gb_ascii_az_a 

ASCII 'a'.

k_gb_ascii_az_z 

Letters in a-z.

k_gb_case_delta 

'a' - 'A'.

k_gb_ascii_0 

ASCII '0'.

k_gb_digits 

Digit count.

Definition at line 70 of file glyph_bench.c.

◆ gb_dim_t

enum gb_dim_t : uint32_t

Workload model dimensions (no bare literals).

Enumerator
k_gb_pages 

Pages rendered in the session.

k_gb_page_glyphs 

Glyph draws per page (a dense page).

k_gb_reread_pages 

Re-render each page this many times (turns).

k_gb_body_px 

Body text font size.

k_gb_heading_px 

Heading font size.

k_gb_heading_pct 

% of glyphs drawn at the heading size.

k_gb_cap_pct 

% of letters drawn as capitals.

k_gb_punct_pct 

% of glyphs drawn as punctuation.

k_gb_digit_pct 

% of glyphs drawn as digits.

k_gb_pct_base 

Percentage base.

k_gb_cell_bytes 

Bench cell size (content-irrelevant).

k_gb_buckets 

Hash buckets for the atlas.

k_gb_prod_cell_kib 

Production cell cost (192x192 alpha8) KiB.

k_gb_max_budget 

Largest swept atlas capacity.

k_gb_decimal_scale 

Two decimal digits for percentages.

k_gb_dec_radix 

Decimal renderer radix.

k_gb_budget_width 

Budget report field width.

k_gb_ram_width 

RAM report field width.

k_gb_hit_width 

Whole-part width before .NN.

k_gb_raster_width 

Rasterization report field width.

Definition at line 46 of file glyph_bench.c.

◆ gb_freq_t

enum gb_freq_t : uint32_t

Sum of s_gb_letter_freq (the selection range).

Enumerator
k_gb_freq_total 

Sum of the 26 letter weights above.

Definition at line 100 of file glyph_bench.c.

◆ gb_seed_t

enum gb_seed_t : uint64_t

Deterministic xorshift64 seed.

Enumerator
k_gb_seed 

Fixed seed.

Definition at line 82 of file glyph_bench.c.

Function Documentation

◆ internal_gb_below()

uint32_t internal_gb_below ( uint64_t * s,
uint32_t span )
static

Draw a uniform pseudo-random integer in [0, span).

Advances internal_gb_rng once and reduces modulo span. The modulo bias is negligible for the small spans this workload uses and does not affect the cache hit/miss decision being measured.

Parameters
[in,out]sGenerator state, advanced by one step when span > 0.
[in]spanExclusive upper bound of the range.
Returns
A value in [0, span).
Return values
0span was 0 (an empty range is reported as 0).
Precondition
s is non-NULL and seeded.
span fits the intended selection range.
Postcondition
s is advanced by exactly one step when span is non-zero.
The result is strictly less than span (or 0 when span is 0).
Note
Not thread-safe; shares s with the caller.
Since
0.1.0

Definition at line 257 of file glyph_bench.c.

References internal_gb_rng(), and RA8_INTERNAL.

Referenced by internal_gb_pick_codepoint(), internal_gb_pick_letter(), and internal_submit_access().

◆ internal_gb_pick_codepoint()

uint32_t internal_gb_pick_codepoint ( uint64_t * s)
static

Choose one codepoint for the glyph stream from the weighted mix.

Rolls once to split the repertoire into punctuation/space (k_gb_punct_pct), digits (k_gb_digit_pct) and letters (the remainder); for a letter it draws a frequency-weighted lowercase codepoint (internal_gb_pick_letter) and upper-cases it with probability k_gb_cap_pct. The distribution mirrors body text so the atlas working set matches a real page.

Parameters
[in,out]sGenerator state, advanced during selection.
Returns
The chosen glyph codepoint (letter, digit, or punctuation/space).
Return values
32(space) when the punctuation roll selected the first repertoire entry, s_gb_punct[0].
Precondition
s is non-NULL and seeded.
The percentage constants sum to at most k_gb_pct_base.
Postcondition
s is advanced by one or more steps.
The result is a printable ASCII codepoint.
Note
Not thread-safe; shares s with the caller.
Since
0.1.0

Definition at line 324 of file glyph_bench.c.

References internal_gb_below(), internal_gb_pick_letter(), k_gb_ascii_0, k_gb_cap_pct, k_gb_case_delta, k_gb_digit_pct, k_gb_digits, k_gb_pct_base, k_gb_punct_pct, RA8_INTERNAL, and s_gb_punct.

Referenced by internal_submit_access().

◆ internal_gb_pick_letter()

uint32_t internal_gb_pick_letter ( uint64_t * s)
static

Pick a lowercase letter codepoint weighted by English frequency.

Draws a value in [0, k_gb_freq_total) and walks the cumulative s_gb_letter_freq table, so 'e'/'t'/'a' appear far more often than 'q'/'z' – the distribution that makes the glyph cache behave like real text. The final fallthrough returns 'a' only if a rounding gap leaves the draw unmatched.

Parameters
[in,out]sGenerator state, advanced during selection.
Returns
An ASCII lowercase codepoint in 'a'..'z'.
Return values
97('a') the frequency walk fell through (draw exceeded the table sum).
Precondition
s is non-NULL and seeded.
s_gb_letter_freq sums to k_gb_freq_total.
Postcondition
s is advanced.
The result is a valid lowercase-letter codepoint.
Note
Not thread-safe; shares s with the caller.
Since
0.1.0

Definition at line 285 of file glyph_bench.c.

References internal_gb_below(), k_gb_ascii_az_a, k_gb_ascii_az_z, k_gb_freq_total, RA8_INTERNAL, and s_gb_letter_freq.

Referenced by internal_gb_pick_codepoint().

◆ internal_gb_render()

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

Atlas render-on-miss callback: stand in for one rasterisation.

The atlas invokes this on a cache miss to fill the freed cell. Hit / miss / eviction depends only on the key stream and the budget, not on the bitmap content, so this stub just zeroes the cell and reports a 1x1 glyph – each call therefore counts as exactly one rasterisation the renderer would have performed, keeping the measured hit rate exact while the bench stays cheap.

Parameters
[in]ctxUnused render context (the bench carries no state).
[in]keyUnused glyph key (content is irrelevant to hit rate).
[out]cellCell memory to fill; zeroed here.
[in]cell_bytesSize of cell in bytes.
[out]out_wReceives the glyph width (1).
[out]out_hReceives the glyph height (1).
Returns
Render status.
Return values
k_ra8_okAlways; the stub cannot fail.
Precondition
cell is non-NULL with at least cell_bytes bytes.
out_w and out_h are non-NULL.
Postcondition
cell is zeroed and out_w / out_h are set to 1.
No global state is touched.
Note
Not thread-safe; matches the single-threaded bench driver.
Since
0.1.0

Definition at line 369 of file glyph_bench.c.

References k_ra8_ok, memset(), and RA8_INTERNAL.

Referenced by internal_run_budget().

◆ internal_gb_rng()

uint64_t internal_gb_rng ( uint64_t * s)
static

Advance a fixed-seed xorshift64 generator and return the new state.

The standard xorshift64 recurrence (shifts 13/7/17) over s, updated in place. Deterministic across runs and platforms, so a given seed always produces the same glyph stream – which is what makes the benched hit rate exactly reproducible.

Parameters
[in,out]sThe 64-bit generator state; replaced with the next state.
Returns
The next 64-bit state value.
Return values
0Never, for a non-zero seed: xorshift64 cannot reach 0 from a non-zero state, and k_gb_seed is non-zero.
Precondition
s is non-NULL.
s was seeded non-zero (k_gb_seed).
Postcondition
s holds the advanced state.
The return value equals the new s.
Note
Not thread-safe; each caller owns its own state word.
Since
0.1.0

Definition at line 225 of file glyph_bench.c.

References k_gb_xs_a, k_gb_xs_b, k_gb_xs_c, and RA8_INTERNAL.

Referenced by internal_gb_below().

◆ internal_log_byte()

void internal_log_byte ( void * context,
uint8_t byte )
static

Forward one logger byte into the bound diagnostic stream.

Adapts the repository logger's byte callback to the same bounded stream contract used for normal benchmark diagnostics.

Parameters
[in,out]contextBound ra8_io_stream_t destination.
[in]byteByte emitted by the shared logger.
Returns
Nothing.
Precondition
context points to a bound stream.
Logger calls are serialized by the benchmark thread.
Postcondition
The byte is offered exactly once to the diagnostic stream.
A rejected diagnostic byte is dropped without recursion.
Note
The logger callback ABI cannot return a sink failure.
Since
0.1.0

Definition at line 165 of file glyph_bench.c.

References RA8_INTERNAL, and ra8_io_stream_putc().

Referenced by internal_output_init().

◆ internal_output_init()

ra8_err_t internal_output_init ( void )
static

Bind process output descriptors and make broken pipes observable.

Installs non-owning raw-descriptor adapters for the process streams, then binds the logger only after both adapters are valid.

Returns
Canonical stream-composition status.
Return values
k_ra8_okBoth borrowed descriptors are bound.
k_ra8_err_comm_errorSIGPIPE disposition setup failed.
otherA raw-descriptor binding failed.
Precondition
No output has been attempted.
Standard output and standard error remain process-owned.
Postcondition
Success binds both streams for the process lifetime.
SIGPIPE is ignored so the backend reports EPIPE.
Note
Host composition only; descriptor ownership is not transferred.
Since
0.1.0

Definition at line 185 of file glyph_bench.c.

References internal_log_byte(), k_ra8_err_comm_error, k_ra8_ok, RA8_INTERNAL, ra8_io_stream_posix_init(), ra8_log_init(), ra8_log_set_byte_sink(), s_gb_diagnostic, s_gb_diagnostic_posix, s_gb_output, and s_gb_output_posix.

Referenced by main().

◆ internal_put_padded_u64()

ra8_err_t internal_put_padded_u64 ( ra8_io_stream_t * stream,
uint64_t value,
uint32_t width )
static

Write one unsigned value left-padded to a fixed field width.

Counts decimal digits arithmetically, emits the required leading spaces, and delegates the value conversion to the bounded stream helper.

Parameters
[in,out]streamBound destination stream.
[in]valueValue to render.
[in]widthMinimum field width.
Returns
Canonical stream status.
Return values
k_ra8_okThe complete padded value was accepted.
otherThe first rejected padding or value write.
Precondition
stream is non-null and bound.
width is a small human-report width.
Postcondition
Success writes spaces followed by the complete decimal value.
Failure stops at the first rejected write.
Note
Thread-safe across distinct streams.
Since
0.1.0

Definition at line 542 of file glyph_bench.c.

References k_gb_dec_radix, k_ra8_ok, ra8_io_stream_put_u64(), and ra8_io_stream_putc().

Referenced by internal_report_row().

◆ internal_replay_page_glyphs()

ra8_err_t internal_replay_page_glyphs ( ra8_glyph_atlas_t * atlas,
uint64_t * page_rng )
static

Replay one page's fixed glyph-access sequence against a running RNG.

Submits k_gb_page_glyphs sequential accesses, stopping at the first failure so the caller's reread loop can propagate it.

Parameters
[in,out]atlasInitialized measured atlas.
[in,out]page_rngRunning PRNG state advanced by each access.
Returns
Canonical atlas status.
Return values
k_ra8_okEvery glyph access in the page completed.
otherThe first glyph access failure.
Precondition
atlas is non-null and ready for ra8_glyph_atlas_get.
page_rng designates a valid PRNG state.
Postcondition
Success advances page_rng through the full page sequence.
Failure stops at the first rejected access.
Note
Deterministic and thread-safe across distinct atlases.
Since
0.1.0

Definition at line 434 of file glyph_bench.c.

References internal_submit_access(), k_gb_page_glyphs, k_ra8_ok, and RA8_INTERNAL.

Referenced by internal_replay_workload().

◆ internal_replay_workload()

ra8_err_t internal_replay_workload ( ra8_glyph_atlas_t * atlas)
static

Regenerate and replay the exact legacy session without a trace buffer.

Saves each page's PRNG start state, regenerates it for all rereads, then advances the session from the first pass's ending state.

Parameters
[in,out]atlasInitialized measured atlas.
Returns
Canonical atlas status.
Return values
k_ra8_okThe full deterministic workload completed.
otherThe first glyph access failure.
Precondition
atlas is non-null and ready for ra8_glyph_atlas_get.
The fixed seed is non-zero.
Postcondition
Success submits exactly s_gb_access_total accesses.
No generated trace bytes are retained.
Note
Deterministic and thread-safe across distinct atlases.
Since
0.1.0

Definition at line 461 of file glyph_bench.c.

References internal_replay_page_glyphs(), k_gb_pages, k_gb_reread_pages, k_gb_seed, k_ra8_ok, and RA8_INTERNAL.

Referenced by internal_run_budget().

◆ internal_report_header()

ra8_err_t internal_report_header ( void )
static

Write the fixed report preamble and workload dimensions.

Emits the legacy report as bounded constant and integer fragments, avoiding locale, varargs formatting, and a large transient line buffer.

Returns
Canonical output-stream status.
Return values
k_ra8_okThe complete preamble was accepted.
otherThe first rejected fragment or integer write.
Precondition
internal_output_init completed successfully.
The workload constants retain their documented values.
Postcondition
Success writes the exact legacy preamble.
Failure stops before attempting later fields.
Note
Not thread-safe with concurrent writes to s_gb_output.
Since
0.1.0

Definition at line 571 of file glyph_bench.c.

References internal_write_parts(), k_gb_body_px, k_gb_heading_px, k_gb_page_glyphs, k_gb_pages, k_gb_reread_pages, k_ra8_ok, RA8_INTERNAL, ra8_io_stream_put_u32(), ra8_io_stream_put_u64(), ra8_io_stream_puts(), s_gb_access_total, and s_gb_output.

Referenced by internal_run_report().

◆ internal_report_row()

ra8_err_t internal_report_row ( uint32_t budget,
uint32_t hits,
uint32_t rasters )
static

Write one exact table row from integer hit/miss evidence.

Computes the rounded two-decimal percentage with checked-width integer fields so report bytes do not depend on locale or floating point.

Parameters
[in]budgetMeasured cell budget.
[in]hitsMeasured hits.
[in]rastersMeasured misses/rasterizations.
Returns
Canonical output-stream status.
Return values
k_ra8_okThe complete row was accepted.
otherThe first rejected row fragment or integer write.
Precondition
Counters came from one complete internal_run_budget result.
s_gb_access_total is non-zero.
Postcondition
Success writes one newline-terminated legacy-compatible row.
Percentage rounding is integer, locale-independent, and two-decimal.
Note
Not thread-safe with concurrent writes to s_gb_output.
Since
0.1.0

Definition at line 635 of file glyph_bench.c.

References internal_put_padded_u64(), k_gb_budget_width, k_gb_dec_radix, k_gb_decimal_scale, k_gb_hit_width, k_gb_pct_base, k_gb_prod_cell_kib, k_gb_ram_width, k_gb_raster_width, k_ra8_ok, RA8_INTERNAL, ra8_io_stream_put_u32(), ra8_io_stream_putc(), ra8_io_stream_puts(), s_gb_access_total, and s_gb_output.

Referenced by internal_run_report().

◆ internal_run_budget()

ra8_err_t internal_run_budget ( uint32_t budget,
uint32_t * out_hits,
uint32_t * out_rasters )
static

Execute one budget against the caller-visible fixed atlas backing.

Clears and binds the exact semantic workspace, replays the complete deterministic session, then publishes counters only after replay succeeds.

Parameters
[in]budgetActive atlas cell count.
[out]out_hitsMeasured cache hits.
[out]out_rastersMeasured misses/rasterizations.
Returns
Canonical atlas or workload status.
Return values
k_ra8_okThe budget completed and both counters were published.
otherAtlas initialization, replay, or statistics failed.
Precondition
budget is non-zero and at most k_gb_max_budget.
Output pointers are non-null.
Postcondition
Success publishes the exact hit and miss counters.
The process workspace is reusable for the next budget.
Note
Not thread-safe because it reuses s_gb_workspace.
Since
0.1.0

Definition at line 500 of file glyph_bench.c.

References internal_gb_render(), internal_replay_workload(), k_gb_buckets, k_gb_cell_bytes, k_ra8_ok, memset(), ra8_glyph_atlas_init(), ra8_glyph_atlas_stats(), and s_gb_workspace.

Referenced by internal_run_report().

◆ internal_run_report()

ra8_err_t internal_run_report ( void )
static

Run the complete deterministic cache-budget report.

Writes the preamble, measures each fixed budget in order using the single semantic workspace, and appends the legacy no-cache comparison.

Returns
Canonical atlas or output status.
Return values
k_ra8_okEvery measurement and report write completed.
otherThe first atlas, workload, or stream failure.
Precondition
Process streams are bound and the fixed workspace is exclusively owned.
Every swept budget is at most k_gb_max_budget.
Postcondition
Success writes the byte-exact legacy report.
No generated trace or atlas allocation survives the run.
Note
Single-threaded composition root.
Since
0.1.0

Definition at line 696 of file glyph_bench.c.

References internal_report_header(), internal_report_row(), internal_run_budget(), k_ra8_ok, RA8_INTERNAL, ra8_io_stream_put_u64(), ra8_io_stream_puts(), s_gb_access_total, s_gb_budgets, and s_gb_output.

Referenced by main().

◆ internal_submit_access()

ra8_err_t internal_submit_access ( ra8_glyph_atlas_t * atlas,
uint64_t * rng )
static

Generate and submit one deterministic glyph access.

Advances the supplied page-local PRNG through the legacy heading/codepoint choices, then balances every successful atlas get with a matching put.

Parameters
[in,out]atlasInitialized measured atlas.
[in,out]rngPage-local generator state.
Returns
Canonical atlas status.
Return values
k_ra8_okOne glyph access completed.
otherThe atlas rejected the get or matching put operation.
Precondition
atlas and rng are non-null.
rng is a non-zero page-start or continuation state.
Postcondition
Success submits and releases exactly one glyph.
rng advances by the workload's fixed selection sequence.
Note
Bitmap content is irrelevant; internal_gb_render fills each miss.
Since
0.1.0

Definition at line 405 of file glyph_bench.c.

References ra8_glyph_t::bitmap, internal_gb_below(), internal_gb_pick_codepoint(), k_gb_body_px, k_gb_heading_pct, k_gb_heading_px, k_gb_pct_base, k_ra8_ok, ra8_glyph_atlas_get(), ra8_glyph_atlas_put(), and RA8_INTERNAL.

Referenced by internal_replay_page_glyphs().

◆ internal_write_parts()

ra8_err_t internal_write_parts ( ra8_io_stream_t * stream,
const char *const * parts,
size_t count )
static

Write a fixed sequence of NUL-terminated fragments exactly.

Iterates the borrowed fragments without formatting or staging so a short/error result remains attributable to the destination stream.

Parameters
[in,out]streamBound destination stream.
[in]partsFragment vector.
[in]countNumber of entries in parts.
Returns
Canonical stream status.
Return values
k_ra8_okEvery fragment was accepted.
otherThe first rejected fragment's status.
Precondition
stream and parts are non-null.
Every selected fragment is NUL-terminated.
Postcondition
Success writes fragments in array order without separators.
Failure stops before attempting later fragments.
Note
Thread-safe across distinct streams.
Since
0.1.0

Definition at line 140 of file glyph_bench.c.

References k_ra8_ok, and ra8_io_stream_puts().

Referenced by internal_report_header(), and main().

◆ main()

int main ( void )

The application entry point Reset_Handler hands control to.

Returns void, not int. This is a freestanding image: there is no hosted C environment, no process and nothing to report an exit status to. ISO C fixes main at int only for a hosted implementation; for a freestanding one (C23 5.1.2.1) the startup function's name and type are implementation-defined, and this is that definition. Reset_Handler discards no value because there is none to discard, and if main ever does return, startup halts the CPU rather than resuming anything.

The firmware lane is compiled -ffreestanding (see cmake/ra8_add_app.cmake) and the flag and this signature travel together: without it both GCC and clang reject a non-int main (-Wmain / -Wmain-return-type). Do not remove one without the other.

That coupling is why the declaration sits behind __STDC_HOSTED__ == 0, which -ffreestanding sets and a hosted build does not. The guard is not defensive dressing: this header is reachable from host builds (the unit tests compile ra8_core natively), and an unguarded void main(void); makes every hosted translation unit that includes it fail with conflicting types for 'main' against its own ISO int main. The declaration therefore exists exactly where its contract does.

Hosted first-party code – everything under tests/ and tools/ – uses the ISO int main(...) contract instead, because it genuinely does run under an OS that reads the exit status. scripts/checks/check_entry_points.py holds each domain to its own contract (#707).

Declared here, once, for the same reason SystemInit is: every vector_table.c used to restate it as a local extern int32_t main(void);, sixteen copies that no compiler ever compared against the definition – and roughly thirty of them had silently drifted out of agreement with the main they called.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has configured the clock tree and VTOR.
Postcondition
Control does not return; the image runs until reset or halt.
Any value the application wanted to report has been logged, not returned.
Note
Not thread-safe; single-threaded startup context only.
Warning
Only valid while the translation unit is compiled -ffreestanding. A hosted build rejects this signature.
See also
SystemInit()
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + BSP audio then plays blocks.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the playback loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + GPT triple, runs sweep.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the sweep loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up clocks + UART + RMII pins, then ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
Postcondition
On clean entry the kernel runs the worker thread once.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up clocks + UART, then enters ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the kernel runs the worker thread forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up LED, console, SDHI pins, then ThreadX.

Precondition
Reset_Handler has copied .data + zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
CPUCLK0 is raised to the PLL1 target before the kernel starts.
On clean entry the SD card thread runs forever.
On any HAL init failure the function halts in __WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + USB-FS + UAC1, then enters the iso-IN feed loop forever.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the iso-IN feed loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
SystemInit set VTOR / FPU / priority grouping.

The application entry point Reset_Handler hands control to.

See file header.

Precondition
Boot init has completed.
The secure-boot library's BLXNS into NS image either failed or was skipped (the call site in ra8_trustzone_init is a no-op on host builds).
Postcondition
Diagnostic counter latched, CPU parked in a halt loop.
Function never returns.
Note
Single-threaded entry.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
On success g_eoh_chapters / g_eoh_crc hold the parsed results, the banner is emitted, and g_eoh_heartbeat advances once per frame.
On any failure g_eoh_err is non-zero and the CPU parks (no heartbeat).
Since
0.1.0

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 chapters/ch0-CRC banner is emitted; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
On success the g_etoc_* result globals hold the parsed TOC values, the banner is emitted, and g_etoc_heartbeat advances once per frame.
On any failure g_etoc_err is non-zero and the CPU parks (no heartbeat).
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss; SystemInit set VTOR/FPU.
Postcondition
The shelf scans on the panel; taps open books, browse, and read.
Since
0.1.0

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

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
On success the cache globals are latched and g_pc_heartbeat advances.
On any failure g_pc_err is non-zero and the CPU parks (no heartbeat).
Since
0.1.0

The application entry point Reset_Handler hands control to.

Profiles power modes once a second.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the profile + blink loop.
On any HAL hard error LED2 latches ON.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
The shared board boot files installed the vector table.
Postcondition
The demo has run once and its verdict banner is streaming steadily.
The CPU idles re-emitting the banner (or halts after a fatal init error).
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the clocks, console, SPI, and SD card, then runs the shared ra8_io VFS round-trip over the SD-over-SPI block device. On success it prints the exact PASS banner the HIL runner and ra8_emulator smoke gate scrape for; on any failure it prints FAIL and parks the core.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the CPU loops forever after the PASS banner.
On any failure the function prints FAIL and halts in WFI.
Note
Not thread-safe; this is the single-threaded app entry.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initialises logging and the console, brings up the OSPI NOR volume, runs the erase-before-write round-trip, and prints a single PASS/FAIL verdict line over SCI8 before parking in an infinite loop.

Precondition
SystemInit configured VTOR / FPU / priority grouping.
The OSPI NOR array is present (modelled in ra8_emulator, real on silicon).
Postcondition
Exactly one PASS or FAIL verdict line has been queued on SCI8.
Control parks in an infinite loop; the function never returns.
Note
Single-threaded; runs to the park loop on the main stack.
Since
0.1.0

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 page-count + render-hash banner is emitted; the CPU loops in WFI.
Since
0.1.0

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 cal=OK / cal=SKIP result and the finger-free touchcal: ready sentinel are emitted; the CPU then loops in WFI.
Since
0.1.0

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 open=OK touch banner is emitted; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Both USB controllers' clocks and pins come up before the kernel so the workers only deal with stack bring-up.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR, FPU, priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging and the clock tree, releases the Cortex-M33 (which then blinks LED1 via ra8_pcntr_set_output()), and idles. See the file header.

Precondition
SystemInit has completed core bring-up.
The M33 is held in reset by hardware until released here.
Postcondition
The M33 has been released and is blinking LED1.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this template.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
The application links ra8_c6link and ESP-hosted generated codecs.
No hardware validation is inferred from this function.
Postcondition
No c6link operation is attempted.
No network or storage state is modified.
Note
Single-threaded compile fixture.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, the clock tree, and the VCOM console, runs the cacheable-SRAM round-trip with the D-cache that SystemInit() enabled through ra8_cache_dcache_enable(), emits the matching PASS / FAIL banner over the console and ra8_log, then parks in WFI. Every byte the self-test touches runs with the L1 caches + MPU enabled by the shared boot (RA8_BOOT_ENABLE_CACHE_MPU + RA8_BOOT_CACHE_VIA_HAL).

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit enabled the MPU + I-cache + D-cache via the ra8_cache HAL.
Postcondition
Exactly one banner (PASS or FAIL) has been emitted.
The core is parked in WFI.
Note
Single-threaded; no RTOS and no IRQ sources in this template.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Publishes the mailbox, releases the Cortex-M33 into the emitter, yields until it signals done, validates the blob the M33 built, then logs the PASS/FAIL verdict and the chapter count read back from the blob. See the file header for the offload narrative.

Precondition
SystemInit has completed core bring-up.
The M33 is held inactive by hardware until released here.
Postcondition
The M33 has built a RABOOK1 blob and the M85 has validated it.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this example.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
On success the CPU heartbeats after epaper: PASS.
On any HAL error the console prints epaper: FAIL and the red LED latches on.
Since
0.1.0

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 chapters/toc/cover banner is emitted; CPU loops in WFI.
Since
0.1.0

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 reader loop runs forever, redrawing on each tap.
A page-1 banner is emitted once after the first render.
Since
0.1.0

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 cover-size / framebuffer-CRC banner is emitted; CPU loops in WFI.
Since
0.1.0

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 panel shows the reader screen and the input loop runs forever.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Publishes the mailbox, arms the IPC0 wake and configures the LPM block, releases the Cortex-M33 into the reader, waits for the first held page, logs the page-0 verdict, then runs the #150 mode-switch cycle – parking in low-power WFI and waking on the M33's page-turn pokes – before logging the handoff verdict and parking for good. See the file header for the narrative.

Precondition
SystemInit has completed core bring-up.
The M33 is held inactive by hardware until released here.
Postcondition
The M33 has rendered + re-rendered the held page and the M85 is parked.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this example.
Since
0.1.0

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 boot banner is emitted; the reader loop services taps forever.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the timebase then measures forever.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the measure + blink loop forever.
On any HAL init failure the function halts in WFI.
Note
Never returns.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Arms the RIIC1 target and polls the dispatcher.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
The CPU stays in the dispatch poll loop forever.
On any fatal init error the CPU parks in riic_target_panic_halt.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the PASS banner is printed and the CPU loops in WFI.
On any failure the function prints a FAIL line and halts.
Note
Not thread-safe; single-threaded app entry.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the read + print loop forever.
On any HAL hard error LED2 latches ON and the loop exits.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the LIN commander then drives frames.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the LIN-frame + blink loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, "renders" page 0 into the shared mailbox, releases the Cortex-M33 into its hold loop, and parks the M85 in low-power WFI sleep. See the file header for the power-saving narrative.

Precondition
SystemInit has completed core bring-up.
The M33 is held inactive by hardware until released here.
Postcondition
The M33 owns the held page and the M85 is parked.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this example.
Since
0.1.0

The application entry point Reset_Handler hands control to.

The USB clock, pins, console, and the SD card all come up before the kernel so the worker only deals with USB stack bring-up.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR, FPU, priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit configured VTOR / FPU.
Postcondition
On clean bring-up the CPU stays in the poll loop.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler initialized static storage.
SystemInit configured VTOR, FPU, and priority grouping.
Postcondition
The startup banner is printed once.
Control enters ThreadX and never returns normally.
Note
The #707 freestanding contract is declared by ra8_boot_entry.h.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the PASS banner is printed and the CPU heartbeats forever.
On any failure LED2 latches ON and the CPU parks.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, the clock tree, and the VCOM console, runs the three-step self-test (MPU enabled, canonical boot map, Device MMIO), emits the matching PASS / FAIL banner over the console and ra8_log, then parks in WFI.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit installed the boot map via ra8_mpu_apply_boot_map().
Postcondition
Exactly one banner (PASS or a step-specific FAIL) has been emitted.
The core is parked in WFI.
Note
Single-threaded; no RTOS and no IRQ sources in this template.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler initialised the C runtime; SystemInit ran.
The EK-RA8D2 J-Link OB VCOM console is attached for the banner.
Postcondition
The commit + rollback attempts have executed against extra-MRAM.
The verdict banner is emitted once per report cycle.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initialises logging + console, brings up the MRAM volume, runs the wear-levelling + power-cycle-survival flow, and prints a single PASS/FAIL verdict.

Precondition
SystemInit configured VTOR / FPU / priority grouping.
The extra-MRAM region is present (modelled in ra8_emulator, real on silicon).
Postcondition
Exactly one PASS or FAIL verdict line has been queued on SCI8.
Control parks in an infinite loop; the function never returns.
Note
Single-threaded; runs to the park loop on the main stack.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initialises logging + console, brings up the MRAM volume, runs the program/erase round-trip, and prints a single PASS/FAIL verdict.

Precondition
SystemInit configured VTOR / FPU / priority grouping.
The extra-MRAM region is present (modelled in ra8_emulator, real on silicon).
Postcondition
Exactly one PASS or FAIL verdict line has been queued on SCI8.
Control parks in an infinite loop; the function never returns.
Note
Single-threaded; runs to the park loop on the main stack.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the clocks, console, and SDHI bus pins, runs the native SD card identification, fills the payload, then runs the full ra8_io VFS round-trip over the native-SDHI block device. On success it prints the exact PASS banner the HIL runner and ra8_emulator smoke gate scrape for; on any failure it prints FAIL and parks the core.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the CPU loops forever after the PASS banner.
On any failure the function prints FAIL and halts in WFI.
Note
Not thread-safe; this is the single-threaded app entry.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the console and both stdio sinks, retargets the engine's stdio to the in-RAM capture sink, runs the two-backend swap, replays the RAM capture out of the UART, and prints a single PASS/FAIL verdict per abstraction before parking in an infinite loop.

Precondition
SystemInit configured VTOR / FPU / priority grouping.
The OSPI NOR array is present (modelled in ra8_emulator, real on silicon).
Postcondition
A PASS or FAIL verdict line has been queued on SCI8 for each abstraction.
Control parks in an infinite loop; the function never returns.
Note
Single-threaded; runs to the park loop on the main stack.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the clocks, console, and SDHI bus pins, runs the native SD card identification, fills the payload, then writes + reads + compares one raw 512-byte block straight against ra8_sdcard. On success it prints the exact PASS banner; on any failure it prints FAIL and parks the core.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the CPU loops forever after the PASS banner.
On any failure the function prints FAIL and halts in WFI.
Note
Not thread-safe; this is the single-threaded app entry.
Since
0.1.0

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 whoami PASS banner is emitted; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up clocks + UART + RMII + RSIP, then ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
Postcondition
On clean entry the kernel runs the worker thread once.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, the FPU and the priority grouping.
Postcondition
The banner was printed exactly once.
Control passed to ThreadX and never came back.
Note
Everything after tx_kernel_enter happens on ThreadX; the panic-halt below is reached only if the kernel refuses to start.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, the FPU and the priority grouping.
Postcondition
The banner and the resolved pin map were printed exactly once.
Control passed to ThreadX and never came back.
Note
Everything after tx_kernel_enter happens on ThreadX; the panic-halt below is reached only if the kernel refuses to start.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, the FPU and priority grouping.
Postcondition
The probe ran exactly once and printed its verdict.
The CPU stays in a slow heartbeat loop afterwards.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, the FPU and the priority grouping.
Postcondition
The banner was printed exactly once.
Control passed to ThreadX and never came back.
Note
Everything after tx_kernel_enter runs on ThreadX; the panic-halt below is reached only if the kernel refuses to start.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes and arms ADC_B, formats each successful channel sample without variadic I/O, emits the verdict, toggles LED1, and delays.

Precondition
Reset startup and SystemInit completed successfully.
The selected ADC channel matches the board analog connection.
Postcondition
Every PASS verdict follows a successful channel read.
Any read or LED failure leads to the terminal panic helper.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR / FPU / priority grouping.
Postcondition
On success the PASS banner is emitted; otherwise a FAIL line is.
The CPU parks in WFI (observable on ra8_emulator until its budget).
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, releases the Cortex-M33 (which then blinks LED1), and idles. See the file header for the teaching narrative.

Precondition
SystemInit has completed core bring-up.
The M33 is held in reset by hardware until released here.
Postcondition
The M33 has been released and is blinking LED1.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this template.
Since
0.1.0

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 IDCODE/checks PASS banner is emitted; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

See the file header for the full behaviour summary.

Precondition
SystemInit has enabled the caches + MPU (this build defines RA8_BOOT_ENABLE_CACHE_MPU).
The M33 is held in reset by hardware until released here.
Postcondition
The M33 has been released and the round-trip loop is running.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this template.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, the clock tree, and the VCOM console, runs the three-step self-test (cacheable SRAM, RO MRAM const, Device MMIO), emits the matching PASS / FAIL banner over the console and ra8_log, then parks in WFI. Every byte the self-test touches runs with the L1 caches and MPU enabled by the shared boot (RA8_BOOT_ENABLE_CACHE_MPU).

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit enabled the MPU + I-cache + D-cache (cache+MPU build).
Postcondition
Exactly one banner (PASS or a step-specific FAIL) has been emitted.
The core is parked in WFI.
Note
Single-threaded; no RTOS and no IRQ sources in this template.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR, FPU and priority grouping.
Postcondition
The verdict banner is on SCI8 and the CPU parks.
The result globals hold the outcome for SWD probing.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Lights HOCO + PLL, then runs a 1 Hz blink.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the toggle loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

See file header for behaviour summary.

Precondition
Boot init has completed.
CPU1 is held in reset.
Postcondition
CPU1 released and the ping-pong loop running.
Function never returns.
Note
Single-threaded entry.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR, FPU, priority grouping.
Postcondition
Control passes to the active app, or to the ThreadX-hosted DFU device.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss; SystemInit ran.
The embedded image's first two words are a valid MSP + Thumb reset vector.
Postcondition
On success, control is at the image's reset vector in the SRAM run window.
On a failed run-target check, control parks in internal_dcr_panic_halt.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler copied .data and zeroed .bss.
SystemInit set VTOR, FPU, priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit enabled the MPU + caches via RA8_BOOT_ENABLE_CACHE_MPU.
Postcondition
Exactly one PASS/FAIL banner is emitted, then the core parks.
The core ends in WFI so ra8_emulator's idle-stop terminates the run.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes the demo, executes one comparison per period, increments the exported match or mismatch counter, and toggles the matching LED.

Precondition
Reset startup and SystemInit completed successfully.
DOC and the status LEDs are not owned by another context.
Postcondition
Every iteration increments exactly one HIL result counter.
LED1 represents matches and LED2 represents failures or mismatches.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up the clock tree, MSTP, ISR/ELC, and the VCOM console, programs a software-triggered DTC block copy, runs it with the L1 caches + MPU enabled by the shared boot (RA8_BOOT_ENABLE_CACHE_MPU), emits the matching PASS / FAIL banner over the console and ra8_log, then parks in WFI.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit enabled the MPU + caches via RA8_BOOT_ENABLE_CACHE_MPU.
Postcondition
Exactly one PASS/FAIL banner is emitted, then the core parks.
The core ends in WFI so ra8_emulator's idle-stop terminates the run.
Note
Single-threaded; the completion IRQ is left masked and the result polled.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, zeros the shared control block, releases the Cortex-M33, waits for its boot signature, then yields while the M33 counts autonomously to k_bg_target_count. After the M33 sets done, the M85 reads the counter and logs the PASS/FAIL verdict.

Precondition
SystemInit has completed core bring-up.
The M33 is held in reset by hardware until released here.
Postcondition
The M33 has autonomously incremented the counter and set done.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this example.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up logging, releases the Cortex-M33, confirms it booted, runs k_m85_demo_rounds narrated mailbox rounds, then drops into the idle heartbeat. See the file header for the teaching narrative.

Precondition
SystemInit has completed core bring-up.
The M33 is held in reset by hardware until released here.
Postcondition
The M33 has been released and the mailbox exchange is running.
This function never returns to its caller.
Note
Single-threaded; no RTOS on the M85 in this example.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Fires ELC software events once a second.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the trigger + blink loop.
On any HAL hard error LED2 latches ON.
Since
0.1.0

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 geometry-hash banner is emitted; the CPU then loops in WFI.
Since
0.1.0

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 framebuffer hash banner is emitted; the CPU then loops in WFI.
Since
0.1.0

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 bmp/gif framebuffer-CRC banner is emitted; CPU loops in WFI.
Since
0.1.0

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 hit-test / nav result banner is emitted; the CPU loops in WFI.
Since
0.1.0

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 nav-result banner is emitted; the CPU then loops in WFI.
Since
0.1.0

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 per-chapter page-count + render-hash banner is emitted; loops in WFI.
Since
0.1.0

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 svg-size / framebuffer-CRC banner is emitted; CPU loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run the CPU loops forever after the ALL PASS banner.
On any failure the function halts in WFI after a FAIL diagnostic.
Since
0.1.0

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 layer1=ok ... PASS banner is emitted on a programmed GLCDC, or FAIL glcdc on a bring-up failure; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes the demo, tracks falling SW1 edges as counter deltas, and independently increments the exported liveness counter whenever successive GPT samples advance.

Precondition
Reset startup and SystemInit completed successfully.
The board wiring matches the EK-RA8D2 LED1 and SW1 definitions.
Postcondition
During operation, each detected edge toggles LED1.
A terminal control-flow escape parks the core in the panic helper.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes the demo and GPT0, runs one bounded DMA request per iteration, updates the exported match/mismatch counter, and delays.

Precondition
Reset startup and SystemInit completed successfully.
GPT0 and the DMA allocator are not owned by another context.
Postcondition
Every iteration increments exactly one HIL result counter.
Allocated DMA channels are released by internal_run_one.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes and arms GPT0 once, then starts, polls, records the exported pass/failure counters, toggles LED1 on completion, and delays before the next one-shot.

Precondition
Reset startup and SystemInit completed successfully.
GPT0 and LED1 are not owned by another execution context.
Postcondition
Each completed one-shot increments g_gpt_one_shot_match.
Each start or bounded-poll failure increments the mismatch counter.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up both controllers then scans each.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the scan + blink loop forever.
On any HAL hard error the CPU parks.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + IIC_B + console then probes.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the scan + blink loop forever.
On any HAL hard error LED2 latches ON and the loop exits.
Since
0.1.0

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 iic_b facade: up banner is emitted every period in the loop.
On any bring-up failure the CPU BKPT-halts before the loop.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Emits the boot banner, initializes the option-controlled IWDT, samples its counter, and on legal samples queues a refresh, clears status, toggles LED1, and emits the refresh banner.

Precondition
Reset startup and SystemInit completed successfully.
OFS0 contains the window policy represented by the demo constants.
Postcondition
Each reported refresh was requested only within the inclusive window.
Any HAL or output error leads to the terminal panic helper.
Note
Does not return during normal operation.
Since
0.1.0

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 query/commit banner is emitted; the CPU then loops in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Performs one Deep-Sleep cycle, emits the wake banner, then parks in a normal blink loop.

MC/DC:
Compound decision: enter_sleep != ok || any_sci_write != ok. Two atomic conditions x N+1 = 3 vectors – both-ok happy path, enter_sleep fails (covered by host test), sci_write fails (covered by host test).
Precondition
Reset_Handler / SystemInit completed normally.
LPM init has not yet been attempted.
Postcondition
On clean entry the chip emitted both banners and is parked in a normal blink loop, ready for the next bench flash.
On any HAL hard error LED1 latches OFF and the chip halts.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU and priority grouping.
Postcondition
The verdict banner is printed and remains the terminal UART line.
g_pdm_mic_result carries the validated capture result.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes channel zero, formats and enqueues each counter line, toggles LED1, and delays before incrementing the next sample.

Precondition
Reset startup and SystemInit completed successfully.
J-Link may update only the consumer offset in the shared descriptor.
Postcondition
Each successful iteration advances the counter and toggles LED1.
Any producer or LED error leads to the terminal panic helper.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Bench-tests SDRAM and prints MB/s.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the bench + blink loop.
On read-back mismatch LED2 latches ON.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up SPI_B + loops a self-test pattern.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the loopback + blink loop.
On any HAL hard error LED2 latches ON.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Configures GPIO, then launches ThreadX.

Precondition
Reset_Handler has copied .data + zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
The two LED threads are running and SysTick is generating 1 ms ticks for the scheduler.
On any HAL init failure the function halts in __WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler completed .data/.bss init.
SystemInit set VTOR + FPU.
Postcondition
Two CANFD demo threads are running.

The application entry point Reset_Handler hands control to.

Brings up clocks + UART, then enters ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
Postcondition
On clean entry the kernel runs the worker thread once.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + SCI8 then drops into the ThreadX scheduler.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On success the producer/consumer pair runs forever.
On any HAL bring-up failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler completed .data/.bss init.
Postcondition
MPU is enabled with the s_mpu_cfg partition table.
Worker thread is running and blinking LED1.

The application entry point Reset_Handler hands control to.

Brings up clocks + UART + RMII pins, then enters ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
Postcondition
On clean entry the kernel runs the worker thread once.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Raises CPUCLK0, configures LED1, launches ThreadX.

Precondition
Reset_Handler has copied .data + zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
CPUCLK0 is at the PLL1 target before the kernel starts.
On any HAL init failure the function halts in __WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU loops forever after printing the result.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + SCI8 + LED1 then prints.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in the print + blink loop forever.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up SCI8 + ISRs, prints, then echoes via IRQ.

Precondition
Reset_Handler has copied .data and zeroed .bss; SystemInit set VTOR/FPU.
Postcondition
On clean entry the CPU idles while the SCI ISRs echo received bytes.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Initializes and arms ULPT0, then polls its underflow bit. Each event emits the fixed wake banner, stops the channel to clear status, and starts the next interval with the same reload.

Precondition
Reset startup and SystemInit completed successfully.
The EK-RA8D2 console wiring matches the board definition.
Postcondition
Every reported wake corresponds to an observed underflow status bit.
Any HAL or output error leads to the terminal panic helper.
Note
Does not return during normal operation.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Both USB controllers' clocks and pins come up before the kernel so the two workers only deal with stack bring-up.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

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 apps/CRC/flush banner is emitted; CPU loops in WFI.
Since
0.1.0

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 PASS banner is emitted and the panel shows the Library app; the loop polls SW1/SW2 to switch apps live, otherwise idling.
Since
0.1.0

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 PASS banner is emitted and the panel shows the composed chrome; the loop partial-flushes only the status band so the panel updates its clock live (the damage-tracked path), otherwise idling.
Since
0.1.0

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 PASS banner is emitted and the panel shows the composed tree; the loop partial-flushes only the status band so the panel updates its top band live (the damage-tracked path), otherwise idling.
Since
0.1.0

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 PASS banner is emitted and the panel shows the composed widget kit; the loop alternately taps a button and partial-flushes the body band so the panel updates a button live (the damage-tracked path).
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + USB-FS pins + LED1 + ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Brings up CGC + USB-HS pin + LED1 + ThreadX.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On clean entry the CPU stays in tx_kernel_enter forever.
On any HAL init failure the function halts in WFI.
Note
Single entry point; not re-entrant.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Alternates between the HS and FS host ports and runs the file-op suite until it fully passes.

Precondition
Reset_Handler has copied .data and zeroed .bss.
SystemInit has set VTOR, FPU, and priority grouping.
Postcondition
On a clean run every suite verdict line is printed, LED1 is lit, and the CPU parks in WFI.
On any HAL init failure the function halts in WFI.
Since
0.1.0

The application entry point Reset_Handler hands control to.

Precondition
Reset_Handler has copied .data and zeroed .bss.
Postcondition
The verdict banner is on the console; the CPU is parked in WFI.
Since
0.1.0

Definition at line 721 of file glyph_bench.c.

References internal_output_init(), internal_run_report(), internal_write_parts(), k_ra8_ok, and s_gb_diagnostic.

Variable Documentation

◆ s_gb_access_total

const uint64_t s_gb_access_total
static
Initial value:
=
(uint64_t)k_gb_pages * (uint64_t)k_gb_reread_pages * (uint64_t)k_gb_page_glyphs
@ k_gb_reread_pages
Re-render each page this many times (turns).
Definition glyph_bench.c:49
@ k_gb_page_glyphs
Glyph draws per page (a dense page).
Definition glyph_bench.c:48
@ k_gb_pages
Pages rendered in the session.
Definition glyph_bench.c:47

Total glyph accesses in the deterministic session.

Definition at line 385 of file glyph_bench.c.

Referenced by internal_report_header(), internal_report_row(), and internal_run_report().

◆ s_gb_budgets

const uint32_t s_gb_budgets[]
static
Initial value:
=
{16U, 32U, 48U, 64U, 96U, 128U, 192U, 256U}

Swept cache budgets (cell counts).

Definition at line 87 of file glyph_bench.c.

Referenced by internal_run_report().

◆ s_gb_diagnostic

ra8_io_stream_t s_gb_diagnostic
static

Definition at line 117 of file glyph_bench.c.

Referenced by internal_output_init(), and main().

◆ s_gb_diagnostic_posix

ra8_io_stream_posix_state_t s_gb_diagnostic_posix
static

Definition at line 120 of file glyph_bench.c.

Referenced by internal_output_init().

◆ s_gb_letter_freq

const uint16_t s_gb_letter_freq[26]
static
Initial value:
= {
817U, 150U, 278U, 425U, 1270U, 223U, 202U, 609U, 697U,
15U, 77U, 403U, 241U, 675U, 751U, 193U, 10U, 599U,
633U, 906U, 276U, 98U, 236U, 15U, 197U, 7U}

English letter relative frequencies, scaled to a per-mille-ish table indexed by letter (a..z).

Sums to k_gb_freq_total.

Definition at line 94 of file glyph_bench.c.

Referenced by internal_gb_pick_letter().

◆ s_gb_output

ra8_io_stream_t s_gb_output
static

Borrowed stdout/stderr portable stream handles.

Definition at line 116 of file glyph_bench.c.

Referenced by internal_output_init(), internal_report_header(), internal_report_row(), and internal_run_report().

◆ s_gb_output_posix

ra8_io_stream_posix_state_t s_gb_output_posix
static

Raw-descriptor adapter states for the borrowed process streams.

Definition at line 119 of file glyph_bench.c.

Referenced by internal_output_init().

◆ s_gb_punct

const uint32_t s_gb_punct[] = {' ', '.', ',', ';', ':', '\'', '"', '-', '!', '?'}
static

A small punctuation/space repertoire (codepoints).

Definition at line 298 of file glyph_bench.c.

Referenced by internal_gb_pick_codepoint().

◆ s_gb_workspace

gb_workspace_t s_gb_workspace
static

Process-lifetime semantic backing for one measured atlas.

Definition at line 114 of file glyph_bench.c.

Referenced by internal_run_budget().