Expand description
The lockstep gate’s side of this board: per-frame digests of everything the gate compares,
in the spelling scripts/pce_trace.py writes for the reference.
Not a module of the reference: its counterpart there is scripts/state_roundtrip.py’s
observe and digest and scripts/presses.py. A frame’s line holds the frame counter, the
master clock, the count and SHA-1 of the CPU bus log (Board::bus_log: physical address,
value, kind, master clock of every cycle), the SHA-1 of the picture (capture.last_frame:
the rows as little-endian u16, then the dividers), the count and SHA-1 of the mixed audio
(take_audio, little-endian i16 pairs) and the CPU’s whole CpuState.
Structs§
- Press
- A press
BUTTONS@FRAME+HOLD(the reference’sscripts/presses.py): the buttons, joined with-, are held while the count of completed frames is in FRAME .. FRAME+HOLD-1. - Setup
- How a traced machine is built: the command line shared by
pce-trace,pce-state-roundtripandscripts/pce_trace.py(which builds the reference the same way).
Functions§
- cpu_
text - Every field of the CPU’s state, in
CpuState’s order. - detail_
lines - The per-cycle lines of
Board::bus_detail(the gate’s narrowing mode), emptied. - frame_
line - The line of the frame that just ran. Empties the bus log and takes the audio.
- held
- The buttons down while
frameframes have completed. - parse_
press - roundtrip
- Save states, proven complete (the reference’s
scripts/state_roundtrip.pyroundtrip): power on, run to frameatplusextrainstructions (so the save falls anywhere in a frame, between two instructions), save, then build a second system the same way, load the state into it, and run both to frameto. Every frame after the save must be the same on both, by the gate’s own lines. A third run loads the state into a system that has run elsewhere first (to frameat/ 2); and the loaded system, saved at once, must give the same bytes back.Oksays what was compared,Errwhat differed. - run_
frames - Run
framesframes with the setup’s presses; a line a frame. - runahead
- The snapshot pair in a run-ahead pass: every frame is run, a snapshot taken,
aheadmore frames run with other buttons held, and the snapshot put back. Each frame’s line, and the state at the end, must equal those of a run that never looked ahead. - set_
psg_ switch - One of the PSG’s switches by the reference’s attribute name.