-Subproject commit 217bb5eef46deb0eeac7b8f11c9d36d9310feabb
+Subproject commit d4959de3364556560c51cda343d04629a0d1cd1f
include $(isa_src_dir)/rv64si/Makefrag
include $(isa_src_dir)/rv64sv/Makefrag
include $(isa_src_dir)/rv32ui/Makefrag
+include $(isa_src_dir)/rv32si/Makefrag
default: all
endef
$(eval $(call compile_template,rv32ui,-m32))
+$(eval $(call compile_template,rv32si,-m32))
$(eval $(call compile_template,rv64ui))
$(eval $(call compile_template,rv64uf))
$(eval $(call compile_template,rv64uv))
--- /dev/null
+#=======================================================================
+# Makefrag for rv32si tests
+#-----------------------------------------------------------------------
+
+rv32si_sc_tests = \
+ csr \
+ shamt \
+
+rv32si_mc_tests = \
+ ipi \
+
+rv32si_p_tests = $(addprefix rv32si-p-, $(rv32si_sc_tests))
+rv32si_pm_tests = $(addprefix rv32si-pm-, $(rv32si_mc_tests))
+
+spike_tests += $(rv32si_p_tests) $(rv32si_pm_tests)
--- /dev/null
+#*****************************************************************************
+# csr.S
+#-----------------------------------------------------------------------------
+#
+# Test CSRRx and CSRRxI instructions.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+#undef RVTEST_RV64S
+#define RVTEST_RV64S RVTEST_RV32S
+
+#include "../rv64si/csr.S"
--- /dev/null
+#*****************************************************************************
+# ipi.S
+#-----------------------------------------------------------------------------
+#
+# Test interprocessor interrupts.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+#undef RVTEST_RV64S
+#define RVTEST_RV64S RVTEST_RV32S
+
+#include "../rv64si/ipi.S"
--- /dev/null
+#*****************************************************************************
+# csr.S
+#-----------------------------------------------------------------------------
+#
+# Test CSRRx and CSRRxI instructions.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+RVTEST_RV32S
+RVTEST_CODE_BEGIN
+
+ la t0, evec
+ csrw evec, t0
+
+ # Make sure slli with shamt[4] set is legal.
+ TEST_CASE( 2, a0, 65536, li a0, 1; slli a0, a0, 16);
+
+ # Make sure slli with shamt[4] set is not legal.
+ TEST_CASE( 3, x0, 1, slli a0, a0, 32);
+
+ TEST_PASSFAIL
+
+evec:
+ # Trapping on test 3 is good.
+ # Note that since the test didn't complete, TESTNUM is smaller by 1.
+ li t0, 2
+ bne TESTNUM, t0, fail
+
+ # Make sure CAUSE indicates an illegal instructino.
+ csrr t0, cause
+ li t1, CAUSE_ILLEGAL_INSTRUCTION
+ bne t0, t1, fail
+ j pass
+
+RVTEST_CODE_END
+
+ .data
+RVTEST_DATA_BEGIN
+
+ TEST_DATA
+
+RVTEST_DATA_END
TEST_IMM_OP( 15, srli, 0x00008484, 0x21212121, 14 );
TEST_IMM_OP( 16, srli, 0x00000000, 0x21212121, 31 );
- # Verify that shifts only use bottom five bits
-
- TEST_IMM_OP( 17, srli, 0x21212121, 0x21212121, 0xffffffc0 );
- TEST_IMM_OP( 18, srli, 0x10909090, 0x21212121, 0xffffffc1 );
- TEST_IMM_OP( 19, srli, 0x00424242, 0x21212121, 0xffffffc7 );
- TEST_IMM_OP( 20, srli, 0x00008484, 0x21212121, 0xffffffce );
-
-
-
#-------------------------------------------------------------
# Source/Destination tests
#-------------------------------------------------------------
evec:
# Trapping on tests 10, 11, and 13 is usually good news.
- # Note that since the test didn't finished, TESTNUM is smaller by 1.
+ # Note that since the test didn't complete, TESTNUM is smaller by 1.
li t0, 9
beq TESTNUM, t0, privileged
li t0, 10