aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@jrtc27.com>2021-10-22 15:15:00 +0100
committerGitHub <noreply@github.com>2021-10-22 15:15:00 +0100
commit9b38e33c766c7c0397b9d51bf91544db391be670 (patch)
treeaee1fe8abd89feb13d924f7f39f346478e0dfd24 /test
parent1c7584bb501bb6d4cbc3b95cb22e008220fb537a (diff)
downloadsail-riscv-9b38e33c766c7c0397b9d51bf91544db391be670.zip
sail-riscv-9b38e33c766c7c0397b9d51bf91544db391be670.tar.gz
sail-riscv-9b38e33c766c7c0397b9d51bf91544db391be670.tar.bz2
Support D extension on RV32 (#108)
* Use bool for floating point comparison result Using bits_WU (bits(32)) or bits_LU (bits(64)) makes no sense, these are just boolean values, and having fixed-width types is a pain for suporting RV32D (since RV32D would need to truncate, but RV128D would need to extend). Instead represent these as an actual bool to match what the values really are. This could be done with bits(1) but the value is logically a boolean (like the built-in integer comparison operators) not a bit vector of length one so we convert to bool and back for a cleaner interface. * Support compiling RV32F with flen == 64 The code conflated flen and xlen; deconflating them and adding suitable assertions (rather than silently retiring as a no-op that doesn't bump instret) ensures that it can be compiled for RV32 with flen set to 64. Whilst here, add the extensions and truncations that would be needed for RV128F. Note that there are already suitable guards on the decode clauses to ensure these instructions are illegal on RV32. * Support compiling RV32D This copies various bits of XLEN generality from the F code. * Support RV32D loads/stores * Correctly initialise misa.D based on flen not xlen * Makefile: Enable D extension for RV32 This now works so can be enabled. * test: Enable RV32D tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_fp_tests.sh2
-rwxr-xr-xtest/run_tests.sh12
2 files changed, 4 insertions, 10 deletions
diff --git a/test/run_fp_tests.sh b/test/run_fp_tests.sh
index 70ae00f..91e7c80 100755
--- a/test/run_fp_tests.sh
+++ b/test/run_fp_tests.sh
@@ -75,7 +75,7 @@ then
else
red "Building 32-bit RISCV C emulator" "fail"
fi
-for test in $DIR/riscv-tests/rv32uf*.elf $DIR/riscv-tests/rv32mi-p-csr.elf; do
+for test in $DIR/riscv-tests/rv32u{f,d}*.elf $DIR/riscv-tests/rv32mi-p-csr.elf; do
if timeout 5 $RISCVDIR/c_emulator/riscv_sim_RV32 -p $test > ${test%.elf}.cout 2>&1 && grep -q SUCCESS ${test%.elf}.cout
then
green "C-32 $(basename $test)" "ok"
diff --git a/test/run_tests.sh b/test/run_tests.sh
index dceeae9..a132132 100755
--- a/test/run_tests.sh
+++ b/test/run_tests.sh
@@ -60,13 +60,12 @@ else
red "Building 32-bit RISCV OCaml emulator" "fail"
fi
for test in $DIR/riscv-tests/rv32*.elf; do
- # skip D tests on RV32
- pat="rv32ud-.+elf"
+ # skip F/D tests on OCaml for now
+ pat='rv32ud-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
- # skip F tests on RV32 OCaml for now
- pat="rv32uf-.+elf"
+ pat='rv32uf-.+elf'
if [[ $(basename $test) =~ $pat ]];
then continue
fi
@@ -87,11 +86,6 @@ else
red "Building 32-bit RISCV C emulator" "fail"
fi
for test in $DIR/riscv-tests/rv32*.elf; do
- # skip D tests on C RV32
- pat='rv32ud-.+elf'
- if [[ $(basename $test) =~ $pat ]];
- then continue
- fi
if timeout 5 $RISCVDIR/c_emulator/riscv_sim_RV32 -p $test > ${test%.elf}.cout 2>&1 && grep -q SUCCESS ${test%.elf}.cout
then
green "C-32 $(basename $test)" "ok"