From: Andrew Waterman Date: Sat, 4 Apr 2015 05:16:00 +0000 (-0700) Subject: Run RV32 tests on spike with --isa=RV32 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74fa7fbd09701e8a63b616cd9a8f78c23a43cbb3;p=riscv-tests.git Run RV32 tests on spike with --isa=RV32 --- diff --git a/env b/env index b79db77..57b1adb 160000 --- a/env +++ b/env @@ -1 +1 @@ -Subproject commit b79db7710e027de487986d03729f7e306c3cd94a +Subproject commit 57b1adbf48ad588366c8f88d91e4c165feb3dae1 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