#!/bin/sh
# Copy Ch363's five-texture scheduler host data. Load the matching RBF first.
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_zs640mt5_epochs.txt
$DATA/sh3_zs640mt50_tex_lpddr.mem
$DATA/sh3_zs640mt51_tex_lpddr.mem
$DATA/sh3_zs640mt52_tex_lpddr.mem
$DATA/sh3_zs640mt53_tex_lpddr.mem
$DATA/sh3_zs640mt54_tex_lpddr.mem
$DATA/feeder_sh3_zs640mt50.mem
$DATA/feeder_sh3_zs640mt51.mem
$DATA/feeder_sh3_zs640mt52.mem
$DATA/feeder_sh3_zs640mt53.mem
$DATA/feeder_sh3_zs640mt54.mem
"

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

echo "Copying Ch363 MT5 host/data files -> $DEST"
# shellcheck disable=SC2086
exec scp $FILES "$DEST"
