diff options
| author | Jon French | 2018-10-15 16:40:38 +0100 |
|---|---|---|
| committer | Jon French | 2018-10-15 16:40:38 +0100 |
| commit | 990e76d84cca9f55e91258d42688f68c2c65f259 (patch) | |
| tree | 3441341a404080e2ab8e26f5ac89c61a52a9469f /test | |
| parent | 73697a01478a61e7fa5385f881731c9111dcd9a4 (diff) | |
Add interpreted RISC-V model to test suite
Diffstat (limited to 'test')
| -rwxr-xr-x | test/riscv/run_tests.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/riscv/run_tests.sh b/test/riscv/run_tests.sh index 512feabf..369e72b2 100755 --- a/test/riscv/run_tests.sh +++ b/test/riscv/run_tests.sh @@ -61,9 +61,9 @@ fi for test in $DIR/tests/*.elf; do if $SAILDIR/riscv/platform "$test" >"${test/.elf/.out}" 2>&1 && grep -q SUCCESS "${test/.elf/.out}" then - green "$(basename $test)" "ok" + green "$(basename $test)_ocaml" "ok" else - red "$(basename $test)" "fail" + red "$(basename $test)_ocaml" "fail" fi done @@ -78,9 +78,27 @@ for test in $DIR/tests/*.elf; do $SAILDIR/sail -elf $test -o ${test%.elf}.bin 2> /dev/null; if timeout 5 $SAILDIR/riscv/riscv_c --binary=0x1000,reset_vec.bin --image=${test%.elf}.bin > ${test%.elf}.cout 2>&1 && grep -q SUCCESS ${test%.elf}.cout then - green "$(basename $test)" "ok" + green "$(basename $test)_c" "ok" else - red "$(basename $test)" "fail" + red "$(basename $test)_c" "fail" + fi +done + +printf "Interpreting RISCV specification...\n" + +for test in $DIR/tests/*.elf; do + if { + timeout 30 $SAILDIR/sail -i $SAILDIR/riscv/riscv_all.sail $SAILDIR/riscv/main.sail > ${test%.elf}.iout 2>&1 <<EOF +:bin 0x1000 $SAILDIR/riscv/reset_vec.bin +:elf $test +main() +:run +EOF + } && grep -q SUCCESS ${test%.elf}.iout + then + green "$(basename $test)_interpreter" "ok" + else + red "$(basename $test)_interpreter" "fail" fi done |
