Merge "prereqs: Ensure we use python 3.9"
diff --git a/create-kshell-device.sh b/create-kshell-device.sh deleted file mode 100755 index 8ec63a9..0000000 --- a/create-kshell-device.sh +++ /dev/null
@@ -1,14 +0,0 @@ -#! /bin/bash -# Create kata shell pty device based on the renode port number as the input -# argument. - -TERM_PORT=${1:-0} -if [[ ${TERM_PORT} -gt 0 ]]; then - TERM_DEV="/tmp/term${TERM_PORT}" -elif [[ ${TERM_PORT} -eq 0 ]]; then - TERM_DEV="/tmp/term" -else - TERM_DEV="/tmp/term1337" -fi - -echo "${TERM_DEV}"
diff --git a/create-kshell-socket-port.sh b/create-kshell-socket-port.sh new file mode 100755 index 0000000..5d42aaa --- /dev/null +++ b/create-kshell-socket-port.sh
@@ -0,0 +1,12 @@ +#! /bin/bash +# Create kata shell socket port based on the renode port number as the input +# argument. + +TERM_PORT=${1:-0} +if [[ ${TERM_PORT} -ge 0 ]]; then + SOCKET_PORT=$((${TERM_PORT} + 3456)) +else + SOCKET_PORT=1337 +fi + +echo "${SOCKET_PORT}"
diff --git a/generate-renode-port-cmd.sh b/generate-renode-port-cmd.sh index 19dce0b..85de006 100755 --- a/generate-renode-port-cmd.sh +++ b/generate-renode-port-cmd.sh
@@ -5,7 +5,7 @@ PORT=${1:-1234} DIR_NAME=$(dirname $(realpath $0)) TERM_PORT_INPUT=$((${PORT} - 1234)) -TERM_DEV=$(${DIR_NAME}/create-kshell-device.sh ${TERM_PORT_INPUT}) +SOCKET_PORT=$("${DIR_NAME}/create-kshell-socket-port.sh" ${TERM_PORT_INPUT}) if [[ ${TERM_PORT_INPUT} -ge 0 ]]; then GDB_PORT=$((${TERM_PORT_INPUT} + 3333)) @@ -13,4 +13,4 @@ GDB_PORT=4670 # 3333 + 1337 fi -echo "\\\$term_port = \\\"${TERM_DEV}\\\"; \\\$gdb_port = ${GDB_PORT};" +echo "\\\$term_port = ${SOCKET_PORT}; \\\$gdb_port = ${GDB_PORT};"
diff --git a/kshell.sh b/kshell.sh index 17a1b20..5dc744a 100755 --- a/kshell.sh +++ b/kshell.sh
@@ -4,6 +4,6 @@ PORT=${1:-1234} DIR_NAME=$(dirname $(realpath $0)) TERM_PORT_INPUT=$((${PORT} - 1234)) -TERM_DEV=$(${DIR_NAME}/create-kshell-device.sh ${TERM_PORT_INPUT}) -echo "Access ${TERM_DEV}" -stty sane -echo -icanon; socat - "${TERM_DEV}",raw; stty sane +SOCKET_PORT=$("${DIR_NAME}/create-kshell-socket-port.sh" ${TERM_PORT_INPUT}) +echo "Access port: ${SOCKET_PORT}" +stty sane -echo -icanon; socat "TCP:localhost:${SOCKET_PORT}" -; stty sane
diff --git a/run-spike-springbok.sh b/run-spike-springbok.sh new file mode 100755 index 0000000..50a8a75 --- /dev/null +++ b/run-spike-springbok.sh
@@ -0,0 +1,25 @@ +#! /bin/bash +# Run spike simulation on springbok ELFs + +if [[ -z "${ROOTDIR}" ]]; then + echo "Source build/setup.sh first" + exit 1 +fi + +if [[ ! -f "${OUT}/host/spike/bin/spike" ]]; then + echo "run \`m -j64 spike\` first" + exit 1 +fi + +if [[ "$#" -eq 0 || $1 == "--help" ]]; then + echo "Usage: run-spike-springbok.sh <elf path>" + exit 0 +fi + +# spike CLI options: +# -m<a:m,b:n>: specifies the memory layout. Springbok currently has 1MB IMEM at +# 0x3200_0000 and 16MB DMEM at 0x3400_0000 +# --varch: specifies the v-ext configuration w.r.t. vlen and elen. +# --pc: ELF entry point. Set at the beginning of IMEM. +"${OUT}/host/spike/bin/spike" -m0x32000000:0x100000,0x34000000:0x1000000 \ + --varch=vlen:512,elen:32 --pc=0x32000000 $@