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

The replacement-policy DIP seam (the eventual firmware Layer-2 seam). More...

#include <cache_bench.h>

Data Fields

const char * name
 Policy name for the report table.
size_t meta_bytes
 Per-frame metadata actually used (RAM cost).
size_t state_base_bytes
 Fixed policy workspace bytes.
size_t state_frame_bytes
 Additional bytes per frame.
int(* init )(cb_cache_t *c)
 Allocate + init policy state for a cb_cache_t.
void(* deinit )(cb_cache_t *c)
 Release policy state.
void(* on_access )(cb_cache_t *c, uint32_t frame)
 A resident key was just hit at frame (update recency/freq).
void(* on_insert )(cb_cache_t *c, uint32_t frame)
 frame was just (re)populated with a freshly-loaded key.
uint32_t(* pick_victim )(cb_cache_t *c, uint32_t *scanned)
 Choose a live frame to evict.

Detailed Description

The replacement-policy DIP seam (the eventual firmware Layer-2 seam).

Every callback is bounded and side-effects only cb_frame_t ::meta and cb_cache_t ::policy_data. pick_victim must return a live frame index; the harness evicts it, inserts the new key there, then calls on_insert.

Definition at line 75 of file cache_bench.h.

Field Documentation

◆ deinit

void(* cache_policy_t::deinit) (cb_cache_t *c)

Release policy state.

Definition at line 83 of file cache_bench.h.

Referenced by cb_replay().

◆ init

int(* cache_policy_t::init) (cb_cache_t *c)

Allocate + init policy state for a cb_cache_t.

Returns 0 ok.

Definition at line 81 of file cache_bench.h.

Referenced by cb_replay().

◆ meta_bytes

size_t cache_policy_t::meta_bytes

Per-frame metadata actually used (RAM cost).

Definition at line 77 of file cache_bench.h.

◆ name

const char* cache_policy_t::name

Policy name for the report table.

Definition at line 76 of file cache_bench.h.

Referenced by internal_report_trace_row().

◆ on_access

void(* cache_policy_t::on_access) (cb_cache_t *c, uint32_t frame)

A resident key was just hit at frame (update recency/freq).

Definition at line 85 of file cache_bench.h.

Referenced by internal_replay_stream().

◆ on_insert

void(* cache_policy_t::on_insert) (cb_cache_t *c, uint32_t frame)

frame was just (re)populated with a freshly-loaded key.

Definition at line 87 of file cache_bench.h.

Referenced by internal_replay_stream().

◆ pick_victim

uint32_t(* cache_policy_t::pick_victim) (cb_cache_t *c, uint32_t *scanned)

Choose a live frame to evict.

Parameters
[out]scannedReceives frames examined this call (WCET proxy).
Returns
Index of the victim frame (always < capacity).

Definition at line 93 of file cache_bench.h.

Referenced by internal_replay_take_frame().

◆ state_base_bytes

size_t cache_policy_t::state_base_bytes

Fixed policy workspace bytes.

Definition at line 78 of file cache_bench.h.

Referenced by cb_replay(), cb_replay_workspace_required(), and internal_replay_open().

◆ state_frame_bytes

size_t cache_policy_t::state_frame_bytes

Additional bytes per frame.

Definition at line 79 of file cache_bench.h.

Referenced by cb_replay(), cb_replay_workspace_required(), and internal_replay_open().


The documentation for this struct was generated from the following file: