Expand description
Offline RISC-V oracle: run a Program on the golden model (Spike) and
read back its final register file as the crate::SIG_BYTES-byte signature.
Used by the mint binary to produce committed golden vectors — never a
build/CI dependency (CI replays the committed vectors, it does not run Spike).
We drive spike -d with a command file (no ELF symbols, no HTIF): materialize
the initial registers, run to the end of the body (the signature epilogue
is excluded — it stores to SIG_BASE, which is below Spike’s DRAM; Spike
reads the registers directly instead), then print each captured register. The
materialization + body is loaded as the single segment of a hand-emitted ELF
(no external assembler/linker needed — we already have the instruction
words). The model runs as the RV64I superset; the generator never names
x16–x31, so the extra registers are irrelevant.
Constants§
- SPIKE_
ISA - ISA string (RV64I superset of PVM2’s compute core).
Functions§
- slot_
to_ xreg - Slot index (0..=12) → RV x-register number (inverse of
reg_slot_or_ff). - spike_
signature - Run
prog’s body (body + signature epilogue, no terminator — the epilogue is stripped: it stores toSIG_BASE, below Spike’s DRAM) on Spike and return its final register file as theSIG_BYTES-byte signature (one LEu64per captured slot, inSIG_XREGSorder). Errors if Spike is missing or its output can’t be parsed.