#!/bin/sh
# Copy Ch368's runtime-CLUT adjacent-frame A/B motion fixture. Run only after
# the GUI-fitted core with REQ_DEPTH=4096 has a clean STA report.
set -eu

DEST="${1:-terasic@192.168.50.161:~}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DATA="$ROOT/sim/data/top_psmct32_raster_demo"

FILES="
$ROOT/tools/ps2_sh3_sched.c
$DATA/sh3_zsrt24_epochs.txt
$DATA/sh3_zsrtb24_epochs.txt
"
for tag in zsrt24 zsrtb24; do
    for k in 0 1 2 3 4 5 6 7; do
        FILES="$FILES
$DATA/sh3_${tag}${k}_tex_lpddr.mem
$DATA/feeder_sh3_${tag}${k}.mem
$DATA/sh3_${tag}${k}_pal.mem"
    done
done

for f in $FILES; do
    [ -f "$f" ] || { echo "MISSING: $f" >&2; exit 1; }
done

echo "Copying Ch368 runtime-CLUT A/B motion files -> $DEST:"
for f in $FILES; do echo "  $(basename "$f")"; done
# shellcheck disable=SC2086
exec scp $FILES "$DEST"
