Add RV32 RVC and breakpoint tests
authorAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 29 Jul 2016 21:47:26 +0000 (14:47 -0700)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Fri, 29 Jul 2016 21:47:42 +0000 (14:47 -0700)
isa/Makefile
isa/rv32mi/Makefrag
isa/rv32mi/breakpoint.S [new file with mode: 0644]
isa/rv32uc/Makefrag [new file with mode: 0644]
isa/rv32uc/rvc.S [new file with mode: 0644]
isa/rv64uc/rvc.S

index b836bbda80840370f3a549b7a98a8b277565db93..f4dab3fdd23760d38f2f1bb40d38190e13d8a630 100644 (file)
@@ -15,6 +15,7 @@ include $(src_dir)/rv64ud/Makefrag
 include $(src_dir)/rv64si/Makefrag
 include $(src_dir)/rv64mi/Makefrag
 include $(src_dir)/rv32ui/Makefrag
 include $(src_dir)/rv64si/Makefrag
 include $(src_dir)/rv64mi/Makefrag
 include $(src_dir)/rv32ui/Makefrag
+include $(src_dir)/rv32uc/Makefrag
 include $(src_dir)/rv32um/Makefrag
 include $(src_dir)/rv32ua/Makefrag
 include $(src_dir)/rv32si/Makefrag
 include $(src_dir)/rv32um/Makefrag
 include $(src_dir)/rv32ua/Makefrag
 include $(src_dir)/rv32si/Makefrag
@@ -68,6 +69,7 @@ tests += $$($(1)_tests)
 endef
 
 $(eval $(call compile_template,rv32ui,-m32))
 endef
 
 $(eval $(call compile_template,rv32ui,-m32))
+$(eval $(call compile_template,rv32uc,-m32))
 $(eval $(call compile_template,rv32um,-m32))
 $(eval $(call compile_template,rv32ua,-m32))
 $(eval $(call compile_template,rv32si,-m32))
 $(eval $(call compile_template,rv32um,-m32))
 $(eval $(call compile_template,rv32ua,-m32))
 $(eval $(call compile_template,rv32si,-m32))
index 636e0972fb62cb2565fb88018c61bb6e1fa3712f..a72624478fb93d2fb5c6108eb3334db0a2cc3d7f 100644 (file)
@@ -3,11 +3,12 @@
 #-----------------------------------------------------------------------
 
 rv32mi_sc_tests = \
 #-----------------------------------------------------------------------
 
 rv32mi_sc_tests = \
+       breakpoint \
        csr \
        csr \
+       mcsr \
        illegal \
        ma_fetch \
        ma_addr \
        illegal \
        ma_fetch \
        ma_addr \
-       mcsr \
        scall \
        sbreak \
        shamt \
        scall \
        sbreak \
        shamt \
diff --git a/isa/rv32mi/breakpoint.S b/isa/rv32mi/breakpoint.S
new file mode 100644 (file)
index 0000000..ecbec6a
--- /dev/null
@@ -0,0 +1,8 @@
+# See LICENSE for license details.
+
+#include "riscv_test.h"
+#undef RVTEST_RV64M
+#define RVTEST_RV64M RVTEST_RV32M
+#define __MACHINE_MODE
+
+#include "../rv64mi/breakpoint.S"
diff --git a/isa/rv32uc/Makefrag b/isa/rv32uc/Makefrag
new file mode 100644 (file)
index 0000000..0586843
--- /dev/null
@@ -0,0 +1,11 @@
+#=======================================================================
+# Makefrag for rv32uc tests
+#-----------------------------------------------------------------------
+
+rv32uc_sc_tests = \
+       rvc \
+
+rv32uc_p_tests = $(addprefix rv32uc-p-, $(rv32uc_sc_tests))
+rv32uc_v_tests = $(addprefix rv32uc-v-, $(rv32uc_sc_tests))
+
+spike32_tests += $(rv32uc_p_tests) $(rv32uc_v_tests)
diff --git a/isa/rv32uc/rvc.S b/isa/rv32uc/rvc.S
new file mode 100644 (file)
index 0000000..debbbd8
--- /dev/null
@@ -0,0 +1,7 @@
+# See LICENSE for license details.
+
+#include "riscv_test.h"
+#undef RVTEST_RV64U
+#define RVTEST_RV64U RVTEST_RV32U
+
+#include "../rv64uc/rvc.S"
index 4f2675ad7944970dc45d89a0923e33d39e404638..6e3cf336300007af47f2a9a5e062bf0100955949 100644 (file)
@@ -47,8 +47,11 @@ RVTEST_CODE_BEGIN
 #endif
 
   RVC_TEST_CASE (11, s0, 0xffffffffffffffe1, c.lui s0, 0xfffe1; c.srai s0, 12)
 #endif
 
   RVC_TEST_CASE (11, s0, 0xffffffffffffffe1, c.lui s0, 0xfffe1; c.srai s0, 12)
+#ifdef __riscv64
   RVC_TEST_CASE (12, s0, 0x000fffffffffffe1, c.lui s0, 0xfffe1; c.srli s0, 12)
   RVC_TEST_CASE (12, s0, 0x000fffffffffffe1, c.lui s0, 0xfffe1; c.srli s0, 12)
-  RVC_TEST_CASE (13, s0, 0x000fffffffffffe1, c.lui s0, 0xfffe1; c.srli s0, 12)
+#else
+  RVC_TEST_CASE (12, s0, 0x000fffe1, c.lui s0, 0xfffe1; c.srli s0, 12)
+#endif
   RVC_TEST_CASE (14, s0, ~0x11, c.li s0, -2; c.andi s0, ~0x10)
   RVC_TEST_CASE (15, s1, 14, li s1, 20; li a0, 6; c.sub s1, a0)
   RVC_TEST_CASE (16, s1, 18, li s1, 20; li a0, 6; c.xor s1, a0)
   RVC_TEST_CASE (14, s0, ~0x11, c.li s0, -2; c.andi s0, ~0x10)
   RVC_TEST_CASE (15, s1, 14, li s1, 20; li a0, 6; c.sub s1, a0)
   RVC_TEST_CASE (16, s1, 18, li s1, 20; li a0, 6; c.xor s1, a0)