aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-04-03 22:16:00 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-04-03 22:16:00 -0700
commit74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3 (patch)
treec35cfa81fdecb1abf12f20fa9e23c8773838c8fb
parent7b8a00a3fba965bf8d0e332cd6f274503289fa2f (diff)
downloadriscv-tests-74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3.zip
riscv-tests-74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3.tar.gz
riscv-tests-74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3.tar.bz2
Run RV32 tests on spike with --isa=RV32
m---------env10
-rw-r--r--isa/Makefile10
-rw-r--r--isa/rv32mi/Makefrag2
-rw-r--r--isa/rv32si/Makefrag2
-rw-r--r--isa/rv32si/shamt.S4
-rw-r--r--isa/rv64mi/dirty.S2
6 files changed, 19 insertions, 11 deletions
diff --git a/env b/env
-Subproject b79db7710e027de487986d03729f7e306c3cd94
+Subproject 57b1adbf48ad588366c8f88d91e4c165feb3dae
diff --git a/isa/Makefile b/isa/Makefile
index 229a509..e4606d5 100644
--- a/isa/Makefile
+++ b/isa/Makefile
@@ -40,6 +40,9 @@ vpath %.S $(isa_src_dir)
%.out: %
$(RISCV_SIM) $< 2> $@
+%.out32: %
+ $(RISCV_SIM) --isa=RV32 $< 2> $@
+
define compile_template
$$($(1)_p_tests): $(1)-p-%: $(1)/%.S
@@ -94,12 +97,13 @@ $(eval $(call compile_template,rv64mi))
tests_dump = $(addsuffix .dump, $(tests))
tests_hex = $(addsuffix .hex, $(tests))
tests_out = $(addsuffix .out, $(spike_tests))
+tests32_out = $(addsuffix .out32, $(spike32_tests))
-run: $(tests_out)
+run: $(tests_out) $(tests32_out)
echo; perl -ne 'print " [$$1] $$ARGV \t$$2\n" if /\*{3}(.{8})\*{3}(.*)/' \
- $(tests_out); echo;
+ $(tests_out) $(tests32_out); echo;
-junk += $(tests) $(tests_dump) $(tests_hex) $(tests_out)
+junk += $(tests) $(tests_dump) $(tests_hex) $(tests_out) $(tests32_out)
#------------------------------------------------------------
# Default
diff --git a/isa/rv32mi/Makefrag b/isa/rv32mi/Makefrag
index e6ab8c8..7560dbc 100644
--- a/isa/rv32mi/Makefrag
+++ b/isa/rv32mi/Makefrag
@@ -16,3 +16,5 @@ rv32mi_mc_tests = \
rv32mi_p_tests = $(addprefix rv32mi-p-, $(rv32mi_sc_tests))
rv32mi_pm_tests = $(addprefix rv32mi-pm-, $(rv32mi_mc_tests))
+
+spike32_tests += $(rv32mi_p_tests) $(rv32mi_pm_tests)
diff --git a/isa/rv32si/Makefrag b/isa/rv32si/Makefrag
index e03819f..4d8f33e 100644
--- a/isa/rv32si/Makefrag
+++ b/isa/rv32si/Makefrag
@@ -13,3 +13,5 @@ rv32si_sc_tests = \
timer \
rv32si_p_tests = $(addprefix rv32si-p-, $(rv32si_sc_tests))
+
+spike32_tests += $(rv32si_p_tests)
diff --git a/isa/rv32si/shamt.S b/isa/rv32si/shamt.S
index 4fe7c2f..615ef68 100644
--- a/isa/rv32si/shamt.S
+++ b/isa/rv32si/shamt.S
@@ -13,7 +13,7 @@
RVTEST_RV32S
RVTEST_CODE_BEGIN
- la t0, stvec
+ la t0, stvec_handler
csrw stvec, t0
# Make sure slli with shamt[4] set is legal.
@@ -24,7 +24,7 @@ RVTEST_CODE_BEGIN
TEST_PASSFAIL
-stvec:
+stvec_handler:
# Trapping on test 3 is good.
# Note that since the test didn't complete, TESTNUM is smaller by 1.
li t0, 2
diff --git a/isa/rv64mi/dirty.S b/isa/rv64mi/dirty.S
index ef4e65c..1cf429a 100644
--- a/isa/rv64mi/dirty.S
+++ b/isa/rv64mi/dirty.S
@@ -17,7 +17,7 @@ RVTEST_CODE_BEGIN
la a1, page_table_1
csrw sptbr, a1
sfence.vm
- li a1, ((MSTATUS_VM & ~(MSTATUS_VM<<1)) * VM_SV43) | ((MSTATUS_PRV1 & ~(MSTATUS_PRV1<<1)) * PRV_S)
+ li a1, ((MSTATUS_VM & ~(MSTATUS_VM<<1)) * VM_SV39) | ((MSTATUS_PRV1 & ~(MSTATUS_PRV1<<1)) * PRV_S)
csrs mstatus, a1
la a1, 1f
csrw mepc, a1