Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Options:
single image file; x86 currently expects two, the kernel and the root task.
- `-w` _TIME_ Number of seconds to wait between each attempt to acquire the lock (default 8)
- `-t` _RETRIES_ Number of retries to perform for acquiring the lock (default -1)
- `--bitstream` _FILE_ Optional bitstream file to load to the FPGA.


`mq sem dumpall|-signal|-wait|-cancel|-info `_<system>_` [-f] [-w `_retry-time_` ] [-t `_retry-count_` ] [-k `_LOCK_\__KEY_` ] [-T` _timeout_`]`
Expand Down
14 changes: 12 additions & 2 deletions scripts/enqueue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ EnqueueUsage() {
echo " -s TEXT Specifies which machine this job is for"
echo " -f FILE [+] Files to use as the job image"
echo " -w TIME Number of seconds to wait between each attempt to acquire the lock (default 8)"
echo " -t RETRIES Number of retries to preform for acquiring the lock (default -1)"
echo " --bitstream FILE Optional bitstream to load to the FPGA"
echo
}

Expand Down Expand Up @@ -78,6 +78,15 @@ Enqueue() {
# that it is a dtb later
dtbflag="-b $1"
;;
--bitstream)
shift
if ! [ -f "$1" ]; then
echo "bitstream file \"$1\" either does not exist, or is not considered a valid file"
exit -1
fi

bitstreamflag="--bitstream $1"
;;
-l)
shift
logfile="$1"
Expand Down Expand Up @@ -245,7 +254,8 @@ Enqueue() {
# parameters '-b' and 'my.dtb'
# 'linux' is deliberately not in quotes so it will not create an empty
# parameter if the flag is not set
SystemRunImage "${system}" "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" ${linux} ${dtbflag} $files
# Ditto for 'bitstreamflag'
SystemRunImage "${system}" "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" ${linux} ${dtbflag} ${bitstreamflag} $files
ret=$?
fi

Expand Down
42 changes: 35 additions & 7 deletions scripts/runner
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,17 @@ RebootConsoleRunTwoFiles() {
return 1
fi
fi
if [ ! -z "${bitstream}" ]; then
bitstreamfile=$(RemoteCommandOn ${HOST} "mktemp")
bitstreamflag="--bitstream $bitstreamfile"
if ! scp "${bitstream}" "${HOST}:${bitstreamfile}"; then
echo "Failed to copy bitstream file"
RemoteCommandOn ${HOST} rm -f "${kernelfile}" "${rootserverfile}" "${logfile}" "${dtbfile}" "${bitstreamfile}"
return 1
fi
fi

ssh -tt -oLogLevel=quiet ${HOST} "stty isig -echoctl -echo; /tftpboot/${machine}/reboot $linux $dtbflag -l '${logfile}' -c '${completion}' -t '${completion_timeout}' -e '${errortxt}' -k '${kernelfile}' -u '${rootserverfile}' ${ka_flag}"
ssh -tt -oLogLevel=quiet ${HOST} "stty isig -echoctl -echo; /tftpboot/${machine}/reboot $linux $dtbflag $bitstreamflag -l '${logfile}' -c '${completion}' -t '${completion_timeout}' -e '${errortxt}' -k '${kernelfile}' -u '${rootserverfile}' ${ka_flag}"
ret=$?
if [ "${output}" != "" ]; then
scp "${HOST}:${logfile}" "${output}"
Expand All @@ -87,12 +96,15 @@ RebootConsoleRunTwoFiles() {
if [ ! -z "${dtb}" ]; then
RemoteCommandOn ${HOST} rm -f "${dtbfile}"
fi
if [ ! -z "${bitstream}" ]; then
RemoteCommandOn ${HOST} rm -f "${bitstreamfile}"
fi
return $ret
fi
if [ "${output}" = "" ]; then
"/tftpboot/${machine}/reboot" $linux $dtbflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -k "${kernel}" -u "${rootserver}" ${ka_flag}
"/tftpboot/${machine}/reboot" $linux $dtbflag $bitstreamflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -k "${kernel}" -u "${rootserver}" ${ka_flag}
else
"/tftpboot/${machine}/reboot" $linux $dtbflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -l "${output}" -k "${kernel}" -u "${rootserver}" ${ka_flag}
"/tftpboot/${machine}/reboot" $linux $dtbflag $bitstreamflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -l "${output}" -k "${kernel}" -u "${rootserver}" ${ka_flag}
fi
}

Expand All @@ -106,6 +118,11 @@ RebootConsoleRunOneFile() {
dtb="$1"
shift
}
[ "$1" = '--bitstream' ] && {
shift
bitstream="$1"
shift
}
completion=$1
completion_timeout=$2
errortxt=$3
Expand Down Expand Up @@ -134,13 +151,21 @@ RebootConsoleRunOneFile() {
if [ ! -z "${dtb}" ]; then
dtbfile=$(RemoteCommandOn ${HOST} "mktemp")
dtbflag="-b $dtbfile"
if ! scp "${dtb}" "${HOST}:${kernelfile}"; then
if ! scp "${dtb}" "${HOST}:${dtbfile}"; then
echo "Failed to copy dtb file"
RemoteCommandOn ${HOST} rm -f "${dtbfile}" "${kernelfile}" "${logfile}"
fi
fi
if [ ! -z "${bitstream}" ]; then
bitstreamfile=$(RemoteCommandOn ${HOST} "mktemp")
bitstreamflag="--bitstream $bitstreamfile"
if ! scp "${bitstream}" "${HOST}:${bitstreamfile}"; then
echo "Failed to copy bitstream file"
RemoteCommandOn ${HOST} rm -f "${bitstreamfile} ${dtbfile}" "${kernelfile}" "${logfile}"
fi
fi

ssh -tt -oLogLevel=quiet ${HOST} "stty isig -echoctl -echo; /tftpboot/${machine}/reboot $linux $dtbflag -l '${logfile}' -c '${completion}' -t '${completion_timeout}' -e '${errortxt}' -k '${kernelfile}' ${ka_flag}"
ssh -tt -oLogLevel=quiet ${HOST} "stty isig -echoctl -echo; /tftpboot/${machine}/reboot $linux $dtbflag $bitstreamflag -l '${logfile}' -c '${completion}' -t '${completion_timeout}' -e '${errortxt}' -k '${kernelfile}' ${ka_flag}"
ret=$?
if [ "${output}" != "" ]; then
scp "${HOST}:${logfile}" "${output}"
Expand All @@ -149,11 +174,14 @@ RebootConsoleRunOneFile() {
if [ ! -z "${dtb}" ]; then
RemoteCommandOn ${HOST} rm -f "${dtbfile}"
fi
if [ ! -z "${bitstream}" ]; then
RemoteCommandOn ${HOST} rm -f "${bitstreamfile}"
fi
return $ret
fi
if [ "${output}" = "" ]; then
"/tftpboot/${machine}/reboot" $linux $dtbflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -k "${kernel}" ${ka_flag}
"/tftpboot/${machine}/reboot" $linux $dtbflag $bitstreamflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -k "${kernel}" ${ka_flag}
else
"/tftpboot/${machine}/reboot" $linux $dtbflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -l "${output}" -k "${kernel}" ${ka_flag}
"/tftpboot/${machine}/reboot" $linux $dtbflag $bitstreamflag -t "${completion_timeout}" -c "${completion}" -e "${errortxt}" -l "${output}" -k "${kernel}" ${ka_flag}
fi
}
11 changes: 9 additions & 2 deletions scripts/system
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,19 @@ SystemRunImage() {
shift 2
kernel="$7"
}

[ $kernel = "--bitstream" ] && {
bitstreamflag="$7 $8"
shift 2
kernel="$7"
}

system_name="$("SystemName_${system}")"

if [ "$("SystemNumFiles_${system}" $linux)" -eq 2 ]; then
rootserver="$8"
RebootConsoleRunTwoFiles $linux $dtbflag "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" "${kernel}" "${rootserver}" "${system_name}"
RebootConsoleRunTwoFiles $linux $dtbflag $bitstreamflag "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" "${kernel}" "${rootserver}" "${system_name}"
else
RebootConsoleRunOneFile $linux $dtbflag "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" "${kernel}" "${system_name}"
RebootConsoleRunOneFile $linux $dtbflag $bitstreamflag "${completion}" "${completion_timeout}" "${errortxt}" "${logfile}" "${keep_alive}" "${kernel}" "${system_name}"
fi
}
62 changes: 62 additions & 0 deletions scripts/systems/cheshire1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/sh
#
# Copyright 2025 UNSW, Sydney
#
# SPDX-License-Identifier: GPL-2.0-only

if [ "${SCRIPT_PATH}" = "" ]; then
echo "This script should not be called directly! Please use mq.sh"
exit -1
fi

SystemNumFiles_cheshire1() {
echo 1
}

SystemName_cheshire1() {
echo "cheshire1"
}

SystemPowerOff_cheshire1() {
RebootShutdown cheshire1
}

Arch_cheshire1() {
echo "riscv"
}

ISA_cheshire1() {
echo "rv64imafdcsuh"
}

SOC_cheshire1() {
echo "PULP Platform Cheshire"
}

CPU_cheshire1() {
echo "CVA6"
}

Cores_cheshire1() {
echo "1"
}

RAM_cheshire1() {
echo "1GB"
}

MaxCLK_cheshire1() {
echo "50MHz"
}

Sel4Plat_cheshire1() {
echo "cheshire"
}

PXELinux_cheshire1() {
echo "no"
}

DTB_cheshire1() {
echo "no"
}