%.out: %
$(RISCV_SIM) $< 2> $@
+%.out32: %
+ $(RISCV_SIM) --isa=RV32 $< 2> $@
+
define compile_template
$$($(1)_p_tests): $(1)-p-%: $(1)/%.S
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
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)
RVTEST_RV32S
RVTEST_CODE_BEGIN
- la t0, stvec
+ la t0, stvec_handler
csrw stvec, t0
# Make sure slli with shamt[4] set is legal.
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
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