1 #include "riscv_test.h"
2 #include "sv_test_macros.h"
4 RVTEST_RV64U # Define TVM used by program.
6 # SV test: sets up x3 and x4 with data, then sets up SV redirection
7 # from register x16 to register x3 with a VL of 2. the add is carried out
8 # on x16 and the redirection means "actually, we want to do that add on x3"
9 # and the VL means "actually we want to do that add on x3 *AND* x4"
10 # x2 and x5 are tested to make sure they're not modified
13 RVTEST_CODE_BEGIN # Start of test code.
15 SV_LD_DATA( x2, testdata , 0)
16 SV_LD_DATA( x3, testdata+8 , 0)
17 SV_LD_DATA( x4, testdata+16, 0)
18 SV_LD_DATA( x5, testdata+24, 0)
21 SET_SV_CSR(1, 16, 0, 3, 1, 0)
30 TEST_SV_IMM(x2, 1001) # should not be modified
33 TEST_SV_IMM(x5, 1002) # should not be modified
35 RVTEST_PASS # Signal success.
38 RVTEST_CODE_END # End of test code.
41 # This section is optional, and this data is NOT saved in the output.
50 # Output data section.
51 RVTEST_DATA_BEGIN # Start of test output data region.
57 RVTEST_DATA_END # End of test output data region.