-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from mrLSD/rv-extension-A-test
RV32/64A extension tests
- Loading branch information
Showing
32 changed files
with
1,519 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#======================================================================= | ||
# Makefrag for rv64ua tests | ||
#----------------------------------------------------------------------- | ||
|
||
rv64ua_sc_tests = \ | ||
amoadd_d amoand_d amomax_d amomaxu_d amomin_d amominu_d amoor_d amoxor_d amoswap_d \ | ||
amoadd_w amoand_w amomax_w amomaxu_w amomin_w amominu_w amoor_w amoxor_w amoswap_w \ | ||
lrsc \ | ||
|
||
rv64ua_p_tests = $(addprefix rv64ua-p-, $(rv64ua_sc_tests)) | ||
rv64ua_v_tests = $(addprefix rv64ua-v-, $(rv64ua_sc_tests)) | ||
|
||
spike_tests += $(rv64ua_p_tests) $(rv64ua_v_tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amoadd_d.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amoadd.d instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sd a0, 0(a3); \ | ||
amoadd.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0xffffffff7ffff800, ld a5, 0(a3)) | ||
|
||
# try again after a cache miss | ||
TEST_CASE(4, a4, 0xffffffff7ffff800, \ | ||
amoadd.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 0xffffffff7ffff000, ld a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amoadd_w.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amoadd.w instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sw a0, 0(a3); \ | ||
amoadd.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0x000000007ffff800, lw a5, 0(a3)) | ||
|
||
# try again after a cache miss | ||
TEST_CASE(4, a4, 0x000000007ffff800, \ | ||
li a1, 0xffffffff80000000; \ | ||
amoadd.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 0xfffffffffffff800, lw a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amoand_d.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amoand.d instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sd a0, 0(a3); \ | ||
amoand.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0xffffffff80000000, ld a5, 0(a3)) | ||
|
||
# try again after a cache miss | ||
TEST_CASE(4, a4, 0xffffffff80000000, \ | ||
li a1, 0x0000000080000000; \ | ||
amoand.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 0x0000000080000000, ld a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amoand.w.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amoand.w instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sw a0, 0(a3); \ | ||
amoand.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0xffffffff80000000, lw a5, 0(a3)) | ||
|
||
# try again after a cache miss | ||
TEST_CASE(4, a4, 0xffffffff80000000, \ | ||
li a1, 0x0000000080000000; \ | ||
amoand.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 0xffffffff80000000, lw a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amomax_d.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amomax.d instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sd a0, 0(a3); \ | ||
amomax.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0xfffffffffffff800, ld a5, 0(a3)) | ||
|
||
TEST_CASE(4, a4, 0, \ | ||
li a1, 1; \ | ||
sd x0, 0(a3); \ | ||
amomax.d a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 1, ld a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# amomax_d.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test amomax.w instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV64U | ||
RVTEST_CODE_BEGIN | ||
|
||
TEST_CASE(2, a4, 0xffffffff80000000, \ | ||
li a0, 0xffffffff80000000; \ | ||
li a1, 0xfffffffffffff800; \ | ||
la a3, amo_operand; \ | ||
sw a0, 0(a3); \ | ||
amomax.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(3, a5, 0xfffffffffffff800, lw a5, 0(a3)) | ||
|
||
TEST_CASE(4, a4, 0, \ | ||
li a1, 1; \ | ||
sw x0, 0(a3); \ | ||
amomax.w a4, a1, 0(a3); \ | ||
) | ||
|
||
TEST_CASE(5, a5, 1, lw a5, 0(a3)) | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END | ||
|
||
.bss | ||
.align 3 | ||
amo_operand: | ||
.dword 0 |
Oops, something went wrong.