Files
lucisv/tools/perf/outcomes.sh
T

48 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# The per-file outcome runs, for the release-to-release outcome diff.
#
# tools/perf/outcomes.sh <lucisv-binary> <label> <opentitan-dir> <out-dir>
#
# `format --check --no-cache` and `check` over the five trees, with every
# per-file line kept. `--no-cache` so the verdict is computed, never recalled,
# and so the two binaries are compared on the same work. Paths are rewritten
# relative to the corpus root, so two runs differ only where an *outcome* did.
#
# Writes `<out-dir>/<label>.format.txt`, `<label>.check.txt`,
# `<label>.check-select.txt`. Diff two labels with:
#
# diff <out-dir>/0.43.0.format.txt <out-dir>/0.49.0.format.txt
#
# Untimed — correctness, not timing — so it is safe to run beside other work.
# Still guarded, like every `lucisv` invocation in this round.
set -u
BIN=${1:?usage: outcomes.sh <binary> <label> <opentitan> <outdir>}
LABEL=${2:?}
OT=${3:?}
OUT=${4:?}
HERE=$(cd "$(dirname "$0")" && pwd)
GUARD="$HERE/../guard.sh"
TREES="hw/ip hw/top_earlgrey/ip hw/top_darjeeling/ip hw/dv hw/vendor"
mkdir -p "$OUT"
emit() {
local suffix=$1
shift
local out="$OUT/${LABEL}.${suffix}.txt"
: >"$out"
for tree in $TREES; do
echo "=== $tree ===" >>"$out"
"$GUARD" -m 8 -t 1800 -- "$BIN" "$@" "$OT/$tree" 2>&1 |
sed "s#$OT/##g" |
LC_ALL=C sort >>"$out"
done
echo "wrote $out"
}
emit format format --no-cache --check
emit check check
emit check-select check --select error,warning,style