The lock and reloads. load takes the board lock before it reconfigures, and the session check sees other runs of this tool and its scripts (their own parents excepted), so a reload waits for the job that holds the board. The scripts do not hold the lock across the steps they run. A reload of the same design, which passes the signature and the ID, is seen by the engine's uptime counter and its reset BOUND register: the engine checks both before it takes a workload or a table as loaded and after every job, and refuses a result read across a reload. A batch that comes back short, and a sampled chain whose sweep count is wrong, are refused. The AXI port. It checks the port's write width as well as its read width; it fills a result page with the illegal cell pair before a write-back and refuses a result still holding it; it refuses a transfer whose page moved. It is written against two traits, so a software link tests it off the board: the guard, the DMA, the sequencer's count, the write-back's layout, dropped accesses. Tests. lowered_settle's five cases and 300 random workloads with fields to 2^40 against the reference; the joint test counts against the chains requested and checks the control's cell family. CI gates on the change, requires tests to run, denies clippy warnings, certifies the model member, runs a job on it, builds on linux-arm64, and replays both testbenches in Icarus Verilog (scripts/run_tb.sh). The names check reads .v, .tcl, .xdc and .dat files. The build. The tool version and each block's version are enforced; the multi-core build refuses the AXI link. The documents. The latency table says how each row was timed; the engine's share of a chain is its own clock count; the sampling energy carries its error and its floor; the known answer is placed in time; the step response is reported; derived figures are marked; the scope of the meter, the guard's window and the DMA's locked pages are stated; provenance says what the private code declared; old names are gone; the build and simulator results have a raw record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
45 lines
2.4 KiB
Shell
Executable file
45 lines
2.4 KiB
Shell
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# Everything a builder runs on their own board, in order: load the engine, the conformance set, the
|
|
# worked examples against the CPU reference, the joint statistics against exact enumeration, the
|
|
# processor-to-logic latency, throughput, then the power campaign. On the board, as root, from a
|
|
# directory holding wai-quantum-landscape-fpga, landscape.bit.bin, this script and power_campaign.sh:
|
|
# sudo setsid nohup sh run_all.sh > /dev/null 2>&1 &
|
|
# and leave the board alone until results-*/power/DONE appears (about three hours). It refuses to
|
|
# start, and stops between steps, if another session is flashing or measuring, and it stops if a
|
|
# check fails: a power figure on a design that failed its checks is not worth the three hours. On a
|
|
# shared board, name the other sessions' tools in WAI_QUANTUM_LANDSCAPE_FPGA_FOREIGN.
|
|
cd "$(dirname "$0")"
|
|
OUT=results-$(date -u +%Y%m%dT%H%M%SZ)
|
|
mkdir -p "$OUT"
|
|
B=./wai-quantum-landscape-fpga
|
|
BIT=${ENGINE_BITSTREAM:-landscape.bit.bin}
|
|
log() { echo "$(date -u +%FT%TZ) $*" >> "$OUT/log.txt"; }
|
|
FOREIGN=$($B foreign) || { echo "another session is on the board: $FOREIGN" > "$OUT/STOPPED"; exit 3; }
|
|
{
|
|
echo "fpga manager flags: $(cat /sys/class/fpga_manager/fpga0/flags)"
|
|
echo "last FPGA write: $(dmesg | grep 'writing.*FPGA' | tail -1)"
|
|
sha256sum "$BIT" "$B"
|
|
} > "$OUT/board_before.txt"
|
|
# A non-zero flags word makes the manager treat a plain bitstream as something else; it is put back.
|
|
FLAGS=$(cat /sys/class/fpga_manager/fpga0/flags)
|
|
echo 0 > /sys/class/fpga_manager/fpga0/flags
|
|
# The flock is not held here across the steps: each step takes it itself, and would wait on this
|
|
# script for ever. Between steps the board is free, which is why the session check runs at each.
|
|
$B load "$BIT" > "$OUT/load.txt" 2>&1 || { log "load failed"; echo "$FLAGS" > /sys/class/fpga_manager/fpga0/flags; exit 2; }
|
|
$B status > "$OUT/status.txt" 2>&1
|
|
step() {
|
|
name=$1; shift
|
|
f=$($B foreign) || { log "STOP: another session is on the board: $f"; echo "$FLAGS" > /sys/class/fpga_manager/fpga0/flags; exit 3; }
|
|
$B "$@" > "$OUT/$name.txt" 2>&1; rc=$?
|
|
log "$name exit=$rc"
|
|
[ "$rc" -eq 0 ] || { echo "$FLAGS" > /sys/class/fpga_manager/fpga0/flags; exit 4; }
|
|
}
|
|
step conform conform
|
|
step agree agree --seeds 200
|
|
step joint joint --seed 2027
|
|
step latency latency
|
|
step throughput throughput
|
|
sh power_campaign.sh "$OUT"
|
|
$B release >> "$OUT/status.txt" 2>&1
|
|
echo "$FLAGS" > /sys/class/fpga_manager/fpga0/flags
|