From 14933a7231ffea792ff979de464b0b897660823f Mon Sep 17 00:00:00 2001 From: Kip Macsai-Goren Date: Mon, 31 Jan 2022 20:03:00 +0000 Subject: [PATCH 1/3] fixed CSR read-only test to have correct output --- .../riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h index 24bc8a09..a044f737 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h @@ -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 // verify that a csr is accessible to read but not to write // Success outputs: + // 0x2, then // 0x11 *** consider changing to something more meaningful // 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? csrr x29, \CSR csrwi \CSR\(), 0xA // Attempt to write a 'random' value to the CSR csrr x30, \CSR - bne x30, x29, 1f // 1f represents r_access_success - li x30, 0xBAD // Write succeeded, violating read only permissions. + bne x30, x29, 1f // 1f represents write_access + li x30, 0x11 // Write succeeded, violating read only permissions. j 2f // j r_access_end -1: // r_access_success - li x30, 0x11 +1: // w_access (test failed) + li x30, 0xBAD 2: // r_access end sd x30, 0(x6) addi x6, x6, 8 From 4d951923f47926a8618045be940e2323f59433df Mon Sep 17 00:00:00 2001 From: Kip Macsai-Goren Date: Mon, 31 Jan 2022 20:04:58 +0000 Subject: [PATCH 2/3] updated minfo test to account for no mconfigptr --- .../privilege/references/WALLY-minfo-01.reference_output | 8 ++++---- .../rv64i_m/privilege/src/WALLY-minfo-01.S | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-minfo-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-minfo-01.reference_output index 372d5de6..880d5dc8 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-minfo-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-minfo-01.reference_output @@ -1,18 +1,18 @@ 00000002 00000000 -00000bad +00000011 00000000 00000002 00000000 -00000bad +00000011 00000000 00000002 00000000 -00000bad +00000011 00000000 00000002 00000000 -00000bad +00000011 00000000 0000000b 00000000 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S index 349580ea..c0adaea7 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S @@ -31,7 +31,7 @@ csr_r_access mvendorid csr_r_access marchid csr_r_access mimpid 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 \ No newline at end of file From 4b94cf9a430ccc8e7b8b3ebc28ca6bded793e3ca Mon Sep 17 00:00:00 2001 From: Kip Macsai-Goren Date: Mon, 31 Jan 2022 20:11:03 +0000 Subject: [PATCH 3/3] Renamed test library --- .../rv64i_m/privilege/src/{NEW-LIB.h => WALLY-TEST-MACROS-64.h} | 0 .../riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/{NEW-LIB.h => WALLY-TEST-MACROS-64.h} (100%) diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-TEST-MACROS-64.h similarity index 100% rename from tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/NEW-LIB.h rename to tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-TEST-MACROS-64.h diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S index c0adaea7..2367a32b 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-minfo-01.S @@ -21,7 +21,7 @@ // 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