Merge branch 'main' of github.com:davidharrishmc/riscv-wally into main

This commit is contained in:
Ross Thompson 2022-01-31 16:32:24 -06:00
commit 2b71d48160
3 changed files with 11 additions and 11 deletions

View File

@ -1,18 +1,18 @@
00000002 00000002
00000000 00000000
00000bad 00000011
00000000 00000000
00000002 00000002
00000000 00000000
00000bad 00000011
00000000 00000000
00000002 00000002
00000000 00000000
00000bad 00000011
00000000 00000000
00000002 00000002
00000000 00000000
00000bad 00000011
00000000 00000000
0000000b 0000000b
00000000 00000000

View File

@ -470,18 +470,18 @@ begin_test: // label here to jump to so we dont go through the trap handler befo
.macro csr_r_access CSR .macro csr_r_access CSR
// verify that a csr is accessible to read but not to write // verify that a csr is accessible to read but not to write
// Success outputs: // Success outputs:
// 0x2, then
// 0x11 *** consider changing to something more meaningful // 0x11 *** consider changing to something more meaningful
// Fault outputs: // Fault outputs:
// 0x2, then
// 0xBAD *** consider changing this one as well. in general, do we need the branching if it hould cause an illegal instruction fault? // 0xBAD *** consider changing this one as well. in general, do we need the branching if it hould cause an illegal instruction fault?
csrr x29, \CSR csrr x29, \CSR
csrwi \CSR\(), 0xA // Attempt to write a 'random' value to the CSR csrwi \CSR\(), 0xA // Attempt to write a 'random' value to the CSR
csrr x30, \CSR csrr x30, \CSR
bne x30, x29, 1f // 1f represents r_access_success bne x30, x29, 1f // 1f represents write_access
li x30, 0xBAD // Write succeeded, violating read only permissions. li x30, 0x11 // Write succeeded, violating read only permissions.
j 2f // j r_access_end j 2f // j r_access_end
1: // r_access_success 1: // w_access (test failed)
li x30, 0x11 li x30, 0xBAD
2: // r_access end 2: // r_access end
sd x30, 0(x6) sd x30, 0(x6)
addi x6, x6, 8 addi x6, x6, 8

View File

@ -21,7 +21,7 @@
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/////////////////////////////////////////// ///////////////////////////////////////////
#include "NEW-LIB.h" #include "WALLY-TEST-MACROS-64.h"
INIT_TESTS INIT_TESTS
@ -31,7 +31,7 @@ csr_r_access mvendorid
csr_r_access marchid csr_r_access marchid
csr_r_access mimpid csr_r_access mimpid
csr_r_access mhartid csr_r_access mhartid
# csr_r_access mconfigptr # *** unrecognized by make-compile?? may be unimplemented?? # csr_r_access mconfigptr # Unimplemented in spike as of 31 Jan 22
END_TESTS END_TESTS