Skip to main content

spike_signature

Function spike_signature 

Source
pub fn spike_signature(prog: &Program) -> Result<[u8; 104]>
Expand description

Run prog’s body (body + signature epilogue, no terminator — the epilogue is stripped: it stores to SIG_BASE, below Spike’s DRAM) on Spike and return its final register file as the SIG_BYTES-byte signature (one LE u64 per captured slot, in SIG_XREGS order). Errors if Spike is missing or its output can’t be parsed.

We don’t ask Spike’s debugger to set registers (it can’t reliably, and the RISC-V boot convention clobbers a0/a1 = hartid/dtb anyway). Instead we prepend register materialization (li64 per captured register, to its seed or 0) so the oracle starts from the same state as our engines, then read each register back — exactly the values the engines’ signature epilogue stores into the scratchpad region.