From 02ab9fe99c4aabd3581d9d66ca27c06a7b469e48 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Fri, 10 Nov 2023 17:58:42 -0600 Subject: [PATCH] Fixed all the bugs associated with the signature and the store side of misaligned access. Load misaligned is still causing some issues. --- src/lsu/align.sv | 2 +- ...ALLY-misaligned-access-01.reference_output | 206 +++++++++--------- 2 files changed, 110 insertions(+), 98 deletions(-) diff --git a/src/lsu/align.sv b/src/lsu/align.sv index 149b7e0bc..7da314ffd 100644 --- a/src/lsu/align.sv +++ b/src/lsu/align.sv @@ -112,7 +112,7 @@ module align import cvw::*; #(parameter cvw_t P) ( assign WordSpillM = (IEUAdrM[OFFSET_BIT_POS-1:2] == '1) & (ByteOffsetM[1:0] != '0) & Funct3M[1:0] == 2'b10; if(P.LLEN == 64) begin logic DoubleSpillM; - assign DoubleSpillM = (IEUAdrM[OFFSET_BIT_POS-1:2] == '1) & Funct3M[1:0] == 2'b11; + assign DoubleSpillM = (IEUAdrM[OFFSET_BIT_POS-1:3] == '1) & (ByteOffsetM[2:0] != '0) & Funct3M[1:0] == 2'b11; assign SpillM = (|MemRWM) & CacheableM & (HalfSpillM | WordSpillM | DoubleSpillM); end else begin assign SpillM = (|MemRWM) & CacheableM & (HalfSpillM | WordSpillM); diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-misaligned-access-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-misaligned-access-01.reference_output index 9755a8520..b0a7caeb3 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-misaligned-access-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-misaligned-access-01.reference_output @@ -295,6 +295,7 @@ deadbeef 7a797877 7e7d7c7b deadbe7f +deadbeef 0100beef # Double2DstData 05040302 09080706 @@ -328,71 +329,10 @@ deadbe7f 79787776 7d7c7b7a dead7f7e -06050403 # Double3DstData -0a090807 -0e0d0c0b -0211100f -16151413 -1a191817 -1e1d1c1b -2221201f -26252423 -2a292827 -2e2d2c2b -0231302f -36353433 -3a393837 -3e3d3c3b -4241403f -46454443 -4a494847 -4e4d4c4b -0251504f -56555453 -5a595857 -5e5d5c5b -6261605f -66656463 -6a696867 -6e6d6c6b -0271706f -76757473 -7a797877 -7e7d7c7b -deadbe7f -07060504 # Double4DestData -0b0a0908 -0f0e0d0c -13021110 -17161514 -1b1a1918 -1f1e1d1c -23222120 -27262524 -2b2a2928 -2f2e2d2c -33023130 -37363534 -3b3a3938 -3f3e3d3c -43424140 -47464544 -4b4a4948 -4f4e4d4c -53025150 -57565554 -5b5a5958 -5f5e5d5c -63626160 -67666564 -6b6a6968 -6f6e6d6c -73027170 -77767574 -7b7a7978 -7f7e7d7c deadbeef -08070605 # Double5DestData +00adbeef # Double3DstData +04030201 +08070605 0c0b0a09 100f0e0d 14130211 @@ -424,39 +364,44 @@ deadbeef 7c7b7a79 de7f7e7d deadbeef -09080706 # Double6DstData -0d0c0b0a -11100f0e -15141302 -19181716 -1d1c1b1a -21201f1e -25242322 -29282726 -2d2c2b2a -31302f2e -35343302 -39383736 -3d3c3b3a -41403f3e -45444342 -49484746 -4d4c4b4a -51504f4e -55545302 -59585756 -5d5c5b5a -61605f5e -65646362 -69686766 -6d6c6b6a -71706f6e -75747302 -79787776 -7d7c7b7a -dead7f7e +deadbeef # Double4DstData +03020100 +07060504 +0b0a0908 +0f0e0d0c +13021110 +17161514 +1b1a1918 +1f1e1d1c +23222120 +27262524 +2b2a2928 +2f2e2d2c +33023130 +37363534 +3b3a3938 +3f3e3d3c +43424140 +47464544 +4b4a4948 +4f4e4d4c +53025150 +57565554 +5b5a5958 +5f5e5d5c +63626160 +67666564 +6b6a6968 +6f6e6d6c +73027170 +77767574 +7b7a7978 +7f7e7d7c deadbeef -0a090807 # Double7DstData +deadbeef # Double5DstData +020100ef +06050403 +0a090807 0e0d0c0b 0211100f 16151413 @@ -487,7 +432,74 @@ deadbeef 7a797877 7e7d7c7b deadbe7f -deadbeef +deadbeef # Double6DstData +0100beef +05040302 +09080706 +0d0c0b0a +11100f0e +15141302 +19181716 +1d1c1b1a +21201f1e +25242322 +29282726 +2d2c2b2a +31302f2e +35343302 +39383736 +3d3c3b3a +41403f3e +45444342 +49484746 +4d4c4b4a +51504f4e +55545302 +59585756 +5d5c5b5a +61605f5e +65646362 +69686766 +6d6c6b6a +71706f6e +75747302 +79787776 +7d7c7b7a +dead7f7e +deadbeef # Double7DstData +00adbeef +04030201 +08070605 +0c0b0a09 +100f0e0d +14130211 +18171615 +1c1b1a19 +201f1e1d +24232221 +28272625 +2c2b2a29 +302f2e2d +34330231 +38373635 +3c3b3a39 +403f3e3d +44434241 +48474645 +4c4b4a49 +504f4e4d +54530251 +58575655 +5c5b5a59 +605f5e5d +64636261 +68676665 +6c6b6a69 +706f6e6d +74730271 +78777675 +7c7b7a79 +de7f7e7d 0fffffff #signature ffffffff ffffffff