#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 1 (the reference's rung 1): SingleStepTests spc700, 256 files x 1,000, judged # natively with the reference's readings (tests/sst_runner.py: registers, PSW, RAM, every # cycle's kind and address, data where non-null, no unlisted write; EF/FF registers # only): 0 fail, the total line equal to the reference's (conformance/expected/sst.txt). # Then every case on both cores with nothing masked: every cycle (kind, address, value, # dummy), the registers and the memory identical (sst --dump against # scripts/reference_sst.py, cached per pin). set -euo pipefail source "$(dirname "$0")/env.sh" require_reference nice -n 19 cargo build --release -q --manifest-path "$ROOT/Cargo.toml" mkdir -p "$ROOT/external" "$REFERENCE_CACHE" out="$ROOT/external/rung1-sst.txt" status=0 nice -n 19 "$ROOT/target/release/sst" "$SST_SPC700" --jobs "${JOBS:-4}" > "$out" || status=$? tail -3 "$out" if [ "$status" != 0 ] || ! diff <(tail -1 "$out") "$ROOT/conformance/expected/sst.txt"; then echo "rung 1: FAILED (a case failed, or the counts differ from the reference's)" exit 1 fi expected="$REFERENCE_CACHE/sst-all.txt" if [ ! -s "$expected" ]; then nice -n 19 "$REFERENCE_PYTHON" -I "$ROOT/scripts/reference_sst.py" "$SST_SPC700" --out "$expected" --jobs "${JOBS:-3}" fi nice -n 19 "$ROOT/target/release/sst" "$SST_SPC700" --dump "$ROOT/external/rung1.rust.txt" --jobs "${JOBS:-4}" if cmp -s "$expected" "$ROOT/external/rung1.rust.txt"; then echo "rung 1: passed, the reference's counts, and $(wc -l < "$expected") cases every cycle identical to the reference's" else cmp "$expected" "$ROOT/external/rung1.rust.txt" || true echo "rung 1: FAILED (the first differing line names the case)" exit 1 fi