From 66b33c09bee145607e9c5b65f4fcc25a78adfbe2 Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 10 May 2024 05:41:00 -0700 Subject: [PATCH] Added Zaamo and Zalrsc support to testbench and regression --- bin/regression-wally | 12 +++++++++--- config/derivlist.txt | 16 ++++++++++++++++ testbench/testbench.sv | 8 ++++---- testbench/tests.vh | 8 ++++---- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/bin/regression-wally b/bin/regression-wally index 8b778907e..fbfc6eece 100755 --- a/bin/regression-wally +++ b/bin/regression-wally @@ -28,9 +28,9 @@ tests = [ ["rv32i", ["arch32i"]], ["rv32imc", ["arch32i", "arch32c", "arch32m", "wally32periph"]], ["rv32gc", ["arch32f", "arch32d", "arch32f_fma", "arch32d_fma", "arch32f_divsqrt", "arch32d_divsqrt", - "arch32i", "arch32priv", "arch32c", "arch32m", "arch32a", "arch32zifencei", "arch32zicond", + "arch32i", "arch32priv", "arch32c", "arch32m", "arch32a_amo", "arch32zifencei", "arch32zicond", "arch32zba", "arch32zbb", "arch32zbc", "arch32zbs", "arch32zfh", "arch32zfh_fma", - "arch32zfh_divsqrt", "arch32zfaf", "arch32zfad", "wally32a", "wally32priv", "wally32periph", "arch32zcb", + "arch32zfh_divsqrt", "arch32zfaf", "arch32zfad", "wally32a_lrsc", "wally32priv", "wally32periph", "arch32zcb", "arch32zbkb", "arch32zbkc", "arch32zbkx", "arch32zknd", "arch32zkne", "arch32zknh"]], ["rv64i", ["arch64i"]] ] @@ -51,7 +51,7 @@ tests_buildrootboot = [ # Separate out floating-point tests for RV64 to speed up coverage tests64gc_nofp = [ ["rv64gc", ["coverage64gc", "arch64i", "arch64priv", "arch64c", "arch64m", "arch64zcb", - "arch64zifencei", "arch64zicond", "arch64a", "wally64a", "wally64periph", "wally64priv", + "arch64zifencei", "arch64zicond", "arch64a_amo", "wally64a_lrsc", "wally64periph", "wally64priv", "arch64zbkb", "arch64zbkc", "arch64zbkx", "arch64zknd", "arch64zkne", "arch64zknh", "arch64zba", "arch64zbb", "arch64zbc", "arch64zbs"]] # add when working: "arch64zicboz" ] @@ -93,6 +93,12 @@ derivconfigtests = [ ["nodcache_rv64gc", ["ahb64"]], ["nocache_rv64gc", ["ahb64"]], +# Atomic variatnts + ["zaamo_rv64gc", ["arch64i", "arch64a_amo"]], + ["zalrsc_rv64gc", ["arch64i", "wally64a_lrsc"]], + ["zaamo_rv32gc", ["arch32i", "arch32a_amo"]], + ["zalrsc_rv32gc", ["arch32i", "wally32a_lrsc"]], + ### add misaligned tests # fp/int divider permutations diff --git a/config/derivlist.txt b/config/derivlist.txt index da3bae5cb..c6bda5792 100644 --- a/config/derivlist.txt +++ b/config/derivlist.txt @@ -511,6 +511,22 @@ BIGENDIAN_SUPPORTED 0 deriv nobigendian_rv64gc rv64gc BIGENDIAN_SUPPORTED 0 +deriv zaamo_rv32gc rv32gc +MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12 | 1 <<3 | 1 << 5); +ZAAMO_SUPPORTED 1 + +deriv zalrsc_rv32gc rv32gc +MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12 | 1 <<3 | 1 << 5); +ZALRSC_SUPPORTED 1 + +deriv zaamo_rv64gc rv64gc +MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12 | 1 <<3 | 1 << 5); +ZAAMO_SUPPORTED 1 + +deriv zalrsc_rv64gc rv64gc +MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12 | 1 <<3 | 1 << 5); +ZALRSC_SUPPORTED 1 + # Floating-point modes supported deriv f_rv32gc rv32gc diff --git a/testbench/testbench.sv b/testbench/testbench.sv index 084bf02c5..91d989394 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -128,7 +128,7 @@ module testbench; if (P.ZICSR_SUPPORTED) tests = {arch64c, arch64cpriv}; else tests = {arch64c}; "arch64m": if (P.M_SUPPORTED) tests = arch64m; - "arch64a": if (P.A_SUPPORTED) tests = arch64a; + "arch64a_amo": if (P.A_SUPPORTED | P.ZAAMO_SUPPORTED) tests = arch64a_amo; "arch64f": if (P.F_SUPPORTED) tests = arch64f; "arch64d": if (P.D_SUPPORTED) tests = arch64d; "arch64f_fma": if (P.F_SUPPORTED) tests = arch64f_fma; @@ -142,7 +142,7 @@ module testbench; "imperas64d": if (P.D_SUPPORTED) tests = imperas64d; "imperas64m": if (P.M_SUPPORTED) tests = imperas64m; "wally64q": if (P.Q_SUPPORTED) tests = wally64q; - "wally64a": if (P.A_SUPPORTED) tests = wally64a; + "wally64a_lrsc": if (P.A_SUPPORTED | P.ZALRSC_SUPPORTED) tests = wally64a_lrsc; "imperas64c": if (P.C_SUPPORTED) tests = imperas64c; else tests = imperas64iNOc; "custom": tests = custom; @@ -181,7 +181,7 @@ module testbench; if (P.ZICSR_SUPPORTED) tests = {arch32c, arch32cpriv}; else tests = {arch32c}; "arch32m": if (P.M_SUPPORTED) tests = arch32m; - "arch32a": if (P.A_SUPPORTED) tests = arch32a; + "arch32a_amo": if (P.A_SUPPORTED | P.ZAAMO_SUPPORTED) tests = arch32a_amo; "arch32f": if (P.F_SUPPORTED) tests = arch32f; "arch32d": if (P.D_SUPPORTED) tests = arch32d; "arch32f_fma": if (P.F_SUPPORTED) tests = arch32f_fma; @@ -193,7 +193,7 @@ module testbench; "imperas32i": tests = imperas32i; "imperas32f": if (P.F_SUPPORTED) tests = imperas32f; "imperas32m": if (P.M_SUPPORTED) tests = imperas32m; - "wally32a": if (P.A_SUPPORTED) tests = wally32a; + "wally32a_lrsc": if (P.A_SUPPORTED | P.ZALRSC_SUPPORTED) tests = wally32a_lrsc; "imperas32c": if (P.C_SUPPORTED) tests = imperas32c; else tests = imperas32iNOc; "wally32i": tests = wally32i; diff --git a/testbench/tests.vh b/testbench/tests.vh index d7ba48eaa..bc99b2ad2 100644 --- a/testbench/tests.vh +++ b/testbench/tests.vh @@ -927,12 +927,12 @@ string imperas32f[] = '{ "rv64i_m/Q/src/WALLY-q-01.S" }; - string wally64a[] = '{ + string wally64a_lrsc[] = '{ `WALLYTEST, "rv64i_m/privilege/src/WALLY-lrsc-01.S" }; - string wally32a[] = '{ + string wally32a_lrsc[] = '{ `WALLYTEST, "rv32i_m/privilege/src/WALLY-lrsc-01.S" }; @@ -974,7 +974,7 @@ string imperas32f[] = '{ "rv64i_m/Zicond/src/czero.nez-01.S" }; - string arch32a[] = '{ + string arch32a_amo[] = '{ `RISCVARCHTEST, "rv32i_m/A/src/amoadd.w-01.S", "rv32i_m/A/src/amoand.w-01.S", @@ -1136,7 +1136,7 @@ string imperas32f[] = '{ "rv64i_m/M/src/remw-01.S" }; - string arch64a[] = '{ + string arch64a_amo[] = '{ `RISCVARCHTEST, "rv64i_m/A/src/amoadd.w-01.S", "rv64i_m/A/src/amoand.w-01.S",