1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-11 23:43:15 +00:00
Anton Blanchard 467630573c Dump CTR, LR and CR on sim termination, and update our tests
Right now our test cases fold the SPRs into the GPRs. That makes
debugging fails more difficult than it needs to be, so print
out the CTR, LR and CR.

We still need to print the XER, but that is in two spots in microwatt
and will take some more work.

This also adds many instructions to the tests that we have added
lately including overflow instructions, CR logicals and mt/mfxer.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2020-01-11 11:09:38 +11:00

35 lines
617 B
Bash
Executable File

#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: run_test.sh <test>"
exit 1
fi
TEST=$1
TMPDIR=$(mktemp -d)
function finish {
rm -rf "$TMPDIR"
}
trap finish EXIT
MICROWATT_DIR=$PWD
cd $TMPDIR
cp ${MICROWATT_DIR}/tests/${TEST}.bin main_ram.bin
${MICROWATT_DIR}/core_tb | sed 's/.*: //' | egrep '^(GPR[0-9]|LR |CTR |XER |CR [0-9])' | sort | grep -v GPR31 | grep -v XER > test.out || true
grep -v "^$" ${MICROWATT_DIR}/tests/${TEST}.out | sort | grep -v GPR31 | grep -v XER > exp.out
cp test.out /tmp
cp exp.out /tmp
diff -q test.out exp.out && echo "$TEST PASS" && exit 0
echo "$TEST FAIL ********"
exit 1