From 3268f27f7ace1286e28ac05ffe4a5c69c7fc6f1d Mon Sep 17 00:00:00 2001 From: Kip Macsai-Goren Date: Wed, 6 Apr 2022 06:00:23 +0000 Subject: [PATCH] Updated PMA tests to comply with all width writes and reads to CLINT --- .../references/WALLY-PMA.reference_output | 24 +++++-------------- .../rv64i_m/privilege/src/WALLY-PMA.S | 12 +++++----- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-PMA.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-PMA.reference_output index 036b97ae..440bee2a 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-PMA.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-PMA.reference_output @@ -1,23 +1,11 @@ beef00b4 # Test 12.3.2.1: read 64 bits success in CLINT -0000dead # all of these read successes are also confirming successful writes -00000007 # write 32 bits with access fault in CLINT -00000000 -00000005 # read 32 bits with access fault in CLINT -00000000 -00000bad -00000000 -00000007 # write 16 bits with access fault in CLINT -00000000 -00000005 # read 16 bits with access fault in CLINT -00000000 -00000bad -00000000 -00000007 # write 8 bits with access fault in CLINT -00000000 -00000005 # read 8 bits with access fault in CLINT -00000000 -00000bad +0000dead # all of these read successes are also confirming successful writes +beef00b5 # read 32 bits success in CLINT (bottom 32 bits sign extended) +ffffffff +000000b6 # read 16 bits success in CLINT (bottom 16 bits sign extended) 00000000 +ffffffb7 # read 8 bits success in CLINT (bottom 8 bits sign extended) +ffffffff 00000001 # execute test with access fault in CLINT 00000000 00000bad diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-PMA.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-PMA.S index 3dd6a91c..917e9f5d 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-PMA.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-PMA.S @@ -85,12 +85,12 @@ test_cases: # Use timecmp register as readable and writable section of the CLINT .8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B4, write64_test # 64-bit write: success .8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B4, read64_test # 64-bit read: success -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B5, write32_test # 32-bit write: failure *** due to non-native length access -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B5, read32_test # 32-bit read: failure -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B6, write16_test # 16-bit write: failure -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B6, read16_test # 16-bit read: failure -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B7, write08_test # 08-bit write: failure -.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B7, read08_test # 08-bit read: failure +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B5, write32_test # 32-bit write: success +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B5, read32_test # 32-bit read: success +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B6, write16_test # 16-bit write: success +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B6, read16_test # 16-bit read: success +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B7, write08_test # 08-bit write: success +.8byte CLINT_BASE + 0x4000, 0x0000DEADBEEF00B7, read08_test # 08-bit read: success .8byte CLINT_BASE, 0xbad, executable_test# execute: instruction access fault