39 lines
921 B
Bash
Executable File
39 lines
921 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
#set -x
|
|
set -e
|
|
|
|
echo "Hello from $(hostname)"
|
|
|
|
path="$1"
|
|
|
|
cd "$path"
|
|
|
|
# First kill any picocom instance
|
|
killall picocom || true
|
|
|
|
# Setup the environment
|
|
. env.sh
|
|
|
|
set -x
|
|
|
|
# Then perform the boot
|
|
./fpgactl -w bitstream.bit -b opensbi.bin -k kernel.bin -i initrd.bin -r rootfs.img
|
|
|
|
# Normal timeouts
|
|
#timeout=$((30 * 60)) # Always stop after 30 min
|
|
#timeout_silent=$((3 * 60)) # Stop if 3 min without output
|
|
|
|
# Timeouts for SPEC benchmarks
|
|
timeout=$((6 * 60 * 60)) # Always stop after 6 h
|
|
timeout_silent=$((2 * 60 * 60)) # Stop if 2 h without output (some benchmarks take 1.6h)
|
|
|
|
# Set dead switch
|
|
sleep $timeout && killall picocom &
|
|
|
|
# Note: --imap igncr is broken so we replace it with LF.
|
|
# See https://github.com/npat-efault/picocom/pull/114
|
|
# It looks like picocom is abandoned, we may want to switch to minicom or
|
|
# stty+cat
|
|
picocom --imap crlf -q -x $(($timeout_silent*1000)) -b 115200 $FPGACTL_UART
|