#include "riscv_test.h" #include "sv_test_macros.h" RVTEST_RV64U # Define TVM used by program. # SV test: vector-vector add # # sets up x3 and x4 with data, sets VL to 2, and carries out # an "add 1 to x3". which actually means "add 1 to x3 *AND* add 1 to x4" # Test code region. RVTEST_CODE_BEGIN # Start of test code. SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_DFLT, SV_W_DFLT, SV_W_DFLT, 1, 1, 1, 0x21, 0x82, 0x0000000000000000) SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_DFLT, SV_W_DFLT, SV_W_32BIT, 1, 1, 1, 0x0000008200000021, 0xa5a5a5a500000000, 0xa5a5a5a5a5a5a5a5) SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_8BIT, SV_W_8BIT, SV_W_DFLT, 1, 1, 1, 0x9, 0x11, 0x19) SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_8BIT, SV_W_8BIT, SV_W_32BIT, 1, 1, 1, 0x0000001100000009, 0xa5a5a5a500000019, 0xa5a5a5a5a5a5a5a5) SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_8BIT, SV_W_8BIT, SV_W_16BIT, 1, 1, 1, 0xa5a5001900110009, 0xa5a5a5a5a5a5a5a5, 0xa5a5a5a5a5a5a5a5) SV_ELWIDTH_TEST(sraw, SV_LDD_DATA, testdata, 8, 0, 3, SV_W_8BIT, SV_W_8BIT, SV_W_8BIT, 1, 1, 1, 0xa5a5a5a5a5191109, 0xa5a5a5a5a5a5a5a5, 0xa5a5a5a5a5a5a5a5) 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 0x0000005949398979 .dword 0x0000005747372717 .dword 0x0000000000000000 .dword 0x0000005242322212 .dword 0x0000005141312111 .dword 0x0000000000000000 # 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.