From: Andrew Waterman Date: Tue, 19 May 2015 09:28:59 +0000 (-0700) Subject: Add basic WFI test X-Git-Url: https://git.libre-soc.org/?p=riscv-tests.git;a=commitdiff_plain;h=80538e49f76fca845e1aa45e6033cd7648975779 Add basic WFI test --- diff --git a/env b/env index bb05f5b..dac4ddd 160000 --- a/env +++ b/env @@ -1 +1 @@ -Subproject commit bb05f5bc5c509e763108f954e23233ba946542ea +Subproject commit dac4ddd40078f31f4c2e766368c237eba84ef68c diff --git a/isa/rv64mi/Makefrag b/isa/rv64mi/Makefrag index 52f6462..b8b1da0 100644 --- a/isa/rv64mi/Makefrag +++ b/isa/rv64mi/Makefrag @@ -10,6 +10,7 @@ rv64mi_sc_tests = \ ma_fetch \ ma_addr \ scall \ + wfi \ sbreak \ timer \ diff --git a/isa/rv64mi/wfi.S b/isa/rv64mi/wfi.S new file mode 100644 index 0000000..bfb130e --- /dev/null +++ b/isa/rv64mi/wfi.S @@ -0,0 +1,8 @@ +# See LICENSE for license details. + +#include "riscv_test.h" +#undef RVTEST_RV64S +#define RVTEST_RV64S RVTEST_RV64M +#define __MACHINE_MODE + +#include "../rv64si/wfi.S" diff --git a/isa/rv64si/Makefrag b/isa/rv64si/Makefrag index f19d840..17596c3 100644 --- a/isa/rv64si/Makefrag +++ b/isa/rv64si/Makefrag @@ -8,6 +8,7 @@ rv64si_sc_tests = \ ma_fetch \ ma_addr \ scall \ + wfi \ sbreak \ timer \ diff --git a/isa/rv64si/wfi.S b/isa/rv64si/wfi.S new file mode 100644 index 0000000..956121a --- /dev/null +++ b/isa/rv64si/wfi.S @@ -0,0 +1,41 @@ +# See LICENSE for license details. + +#***************************************************************************** +# wfi.S +#----------------------------------------------------------------------------- +# +# Test wait-for-interrupt instruction. +# + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV64S +RVTEST_CODE_BEGIN + +#ifdef __MACHINE_MODE + #define sstatus mstatus + #define sie mie + #define sip mip + #undef MIP_SSIP + #define MIP_SSIP MIP_MSIP +#endif + + # Make sure wfi doesn't stall if an interrupt is pending + csrc sstatus, SSTATUS_IE + csrs sie, MIP_SSIP + csrs sip, MIP_SSIP + wfi + + RVTEST_PASS + + TEST_PASSFAIL + +RVTEST_CODE_END + + .data +RVTEST_DATA_BEGIN + + TEST_DATA + +RVTEST_DATA_END