-Subproject commit 4c356d46aace73c1562816a41e0f63948bdb0497
+Subproject commit 68cad7baf3ed0a4553fffd14726d24519ee1296a
ifeq ($(XLEN),64)
include $(src_dir)/rv64ui/Makefrag
+include $(src_dir)/rv64ui/Makefrag.sv
include $(src_dir)/rv64uc/Makefrag
include $(src_dir)/rv64um/Makefrag
include $(src_dir)/rv64ua/Makefrag
define compile_template
$$($(1)_p_tests): $(1)-p-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/p -I$(src_dir)/macros/scalar -T$(src_dir)/../env/p/link.ld $$< -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -I$(src_dir)/../env/p -I$(src_dir)/macros/scalar -I$(src_dir)/macros/simplev -T$(src_dir)/../env/p/link.ld $$< -o $$@
$(1)_tests += $$($(1)_p_tests)
$$($(1)_v_tests): $(1)-v-%: $(1)/%.S
- $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -DENTROPY=0x$$(shell echo \$$@ | md5sum | cut -c 1-7) -std=gnu99 -O2 -I$(src_dir)/../env/v -I$(src_dir)/macros/scalar -T$(src_dir)/../env/v/link.ld $(src_dir)/../env/v/entry.S $(src_dir)/../env/v/*.c $$< -o $$@
+ $$(RISCV_GCC) $(2) $$(RISCV_GCC_OPTS) -DENTROPY=0x$$(shell echo \$$@ | md5sum | cut -c 1-7) -std=gnu99 -O2 -I$(src_dir)/../env/v -I$(src_dir)/macros/scalar -I$(src_dir)/macros/simplev -T$(src_dir)/../env/v/link.ld $(src_dir)/../env/v/entry.S $(src_dir)/../env/v/*.c $$< -o $$@
$(1)_tests += $$($(1)_v_tests)
$(1)_tests_dump = $$(addsuffix .dump, $$($(1)_tests))
--- /dev/null
+#define SV_REG_CSR(type, regkey, elwidth, regidx, isvec, packed) \
+ (regkey | (elwidth<<5) | (type<<7) | (regidx<<8) | (isvec<<14) | (packed<<15))
+#define SV_PRED_CSR(type, regkey, zero, inv, regidx, active) \
+ (regkey | (zero<<5) | (inv<<6) | (type<<7) | (regidx<<8) | (active<<14))
--- /dev/null
+#=======================================================================
+# Makefrag for rv64ui SV tests
+#-----------------------------------------------------------------------
+
+rv64ui_sv_tests = \
+ sv_addi \
+
+rv64ui_p_tests = $(addprefix rv64ui-p-, $(rv64ui_sv_tests))
+rv64ui_v_tests = $(addprefix rv64ui-v-, $(rv64ui_sv_tests))
+
+spike_tests += $(rv64ui_p_tests) $(rv64ui_v_tests)
--- /dev/null
+#include "riscv_test.h"
+#include "sv_test_macros.h"
+
+RVTEST_RV64U # Define TVM used by program.
+
+
+
+# Test code region.
+RVTEST_CODE_BEGIN # Start of test code.
+ csrrw x0, 0x4f2, 2
+ la x1, testdata
+ lw x2, 0(x1)
+ la x1, (testdata+8)
+ lw x3, 0(x1)
+ li x1, SV_REG_CSR(1, 2, 0, 2, 1, 0)
+ csrrw x0, 0x4c0, x1
+ csrrw x0, 0x4f0, 2
+ addi x2, x2, 1 # Should be 42 into $2.
+ csrrwi x0, 0x4f2, 0
+ csrrwi x0, 0x4c0, 0
+ csrrwi x0, 0x4f0, 0
+ li x1, 42 # Desired result 1
+ bne x2, x1, fail # Fail out if doesn't match.
+ li x1, 43 # Desired result 2
+ bne x3, x1, fail # Fail out if doesn't match.
+ RVTEST_PASS # Signal success.
+fail:
+ RVTEST_FAIL
+RVTEST_CODE_END # End of test code.
+
+# Input data section.
+# This section is optional, and this data is NOT saved in the output.
+.data
+ .align 3
+testdata:
+ .dword 41
+ .dword 42
+ .dword 43
+
+# Output data section.
+RVTEST_DATA_BEGIN # Start of test output data region.
+ .align 3
+result:
+ .dword -1
+ .dword -1
+ .dword -1
+RVTEST_DATA_END # End of test output data region.
+