From 38a88862ac05e4eb2513a7314de5260c08359481 Mon Sep 17 00:00:00 2001 From: naichewa Date: Mon, 4 Nov 2024 16:22:42 -0800 Subject: [PATCH 01/25] Added SCKMODE 10 and 11 delay cases to regression tests --- addins/ahbsdc | 1 + addins/cvw-arch-verif | 2 +- addins/riscv-arch-test | 2 +- .../references/WALLY-spi-01.reference_output | 24 ++++++ .../rv32i_m/privilege/src/WALLY-spi-01.S | 78 +++++++++++++++++- .../references/WALLY-spi-01.reference_output | 24 ++++++ .../rv64i_m/privilege/src/WALLY-spi-01.S | 80 ++++++++++++++++++- 7 files changed, 206 insertions(+), 5 deletions(-) create mode 160000 addins/ahbsdc diff --git a/addins/ahbsdc b/addins/ahbsdc new file mode 160000 index 000000000..33418c8dc --- /dev/null +++ b/addins/ahbsdc @@ -0,0 +1 @@ +Subproject commit 33418c8dc11baf63e843b0d35f57d22c1e3182e3 diff --git a/addins/cvw-arch-verif b/addins/cvw-arch-verif index 6d658b7b4..189974e49 160000 --- a/addins/cvw-arch-verif +++ b/addins/cvw-arch-verif @@ -1 +1 @@ -Subproject commit 6d658b7b42c83fd584008d72964cc75d0876b769 +Subproject commit 189974e497d7b8d2c08bb1d151b1ccdeaf3a64c9 diff --git a/addins/riscv-arch-test b/addins/riscv-arch-test index 3843c736e..7152865ac 160000 --- a/addins/riscv-arch-test +++ b/addins/riscv-arch-test @@ -1 +1 @@ -Subproject commit 3843c736e427a2b52a0d06e6220b073afa4be401 +Subproject commit 7152865aca51062c87ff2cbb014e199a24bdc874 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output index 027e02f54..e19f75391 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,6 +146,30 @@ 00000015 +00000010 + +00000010 + +00000010 + +00000010 + +00000010 + +00000010 + +00000011 + +00000011 + +00000011 + +00000011 + +00000011 + +00000011 + 00000011 #delay1 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S index 94defaf87..19b70829c 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S @@ -316,11 +316,87 @@ test_cases: .4byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .4byte rx_data, 0x00000015, read32_test # read rx_data +# SCKCS Delay of 0, SCKMODE 10 +.4byte sck_mode, 0x00000002, write32_test #set sckmode to 10 +.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 10 +.4byte delay0, 0x00050001, write32_test # set sckcs delay to 5 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 10 +.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 10 +.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 10 +.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 10 +.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + + + +# SCKCS Delay of 0, SCKMODE 11 +.4byte sck_mode, 0x00000003, write32_test +.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 11 +.4byte delay0, 0x00050001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 11 +.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 11 +.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 11 +.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 11 +.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + # =========== Test delay1 register =========== # Test inter cs delay - +.4byte sck_mode, 0x00000000, write32_test #reset sck_mode .4byte delay0, 0x00010001, write32_test # reset delay0 register .4byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .4byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output index 8d9ae8bbc..bc17f4beb 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,6 +146,30 @@ 00000000 00000015 00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 00000011 #delay1 00000000 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S index 23cfd169a..a31069470 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S @@ -258,7 +258,7 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000011, read32_test # read rx_data -# =========== Test delay0 register =========== +# =========== Test delay0 register (mode auto)=========== # Test cs-sck delay of 0 with sck phase = 0 (implicit half cycle delay) @@ -320,11 +320,87 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000015, read32_test # read rx_data +# SCKCS Delay of 0, SCKMODE 10 +.8byte sck_mode, 0x00000002, write32_test #set sckmode to 10 +.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 10 +.8byte delay0, 0x00050001, write32_test # set sckcs delay to 5 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 10 +.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 10 +.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 10 +.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 10 +.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + + + +# SCKCS Delay of 0, SCKMODE 11 +.8byte sck_mode, 0x00000003, write32_test +.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 11 +.8byte delay0, 0x00050001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 11 +.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 11 +.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 11 +.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 11 +.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + # =========== Test delay1 register =========== # Test inter cs delay - +.8byte sck_mode, 0x00000000, write32_test #reset sck_mode .8byte delay0, 0x00010001, write32_test # reset delay0 register .8byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .8byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock From 912d593acfd5cc21b5e6d0717631836924ba50e3 Mon Sep 17 00:00:00 2001 From: Daniyal-R-A <97160211+Daniyal-R-A@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:38:51 -0800 Subject: [PATCH 02/25] Enabling Zb* and Zk* --- config/rv32gc/coverage.svh | 12 ++++++++++++ config/rv64gc/coverage.svh | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/config/rv32gc/coverage.svh b/config/rv32gc/coverage.svh index 2eb52541f..522eb24d1 100644 --- a/config/rv32gc/coverage.svh +++ b/config/rv32gc/coverage.svh @@ -10,6 +10,13 @@ `include "RV32M_coverage.svh" `include "RV32F_coverage.svh" `include "RV32D_coverage.svh" +`include "RV32Zba_coverage.svh" +`include "RV32Zbb_coverage.svh" +`include "RV32Zbc_coverage.svh" +`include "RV32Zbs_coverage.svh" +`include "RV32Zbkb_coverage.svh" +`include "RV32Zbkc_coverage.svh" +`include "RV32Zbkx_coverage.svh" `include "RV32ZfaF_coverage.svh" `include "RV32ZfaD_coverage.svh" `include "RV32ZfaZfh_coverage.svh" @@ -22,6 +29,11 @@ `include "RV32ZcbZbb_coverage.svh" `include "RV32Zcf_coverage.svh" `include "RV32Zcd_coverage.svh" +`include "RV32Zaamo_coverage.svh" +`include "RV32Zalrsc_coverage.svh" +`include "RV32Zknd_coverage.svh" +`include "RV32Zkne_coverage.svh" +`include "RV32Zknh_coverage.svh" // Privileged extensions `include "ZicsrM_coverage.svh" diff --git a/config/rv64gc/coverage.svh b/config/rv64gc/coverage.svh index d594a3a44..a293eb5b1 100644 --- a/config/rv64gc/coverage.svh +++ b/config/rv64gc/coverage.svh @@ -10,6 +10,13 @@ `include "RV64M_coverage.svh" `include "RV64F_coverage.svh" `include "RV64D_coverage.svh" +`include "RV64Zba_coverage.svh" +`include "RV64Zbb_coverage.svh" +`include "RV64Zbc_coverage.svh" +`include "RV64Zbs_coverage.svh" +`include "RV64Zbkb_coverage.svh" +`include "RV64Zbkc_coverage.svh" +`include "RV64Zbkx_coverage.svh" `include "RV64ZfaF_coverage.svh" `include "RV32ZfaD_coverage.svh" `include "RV32ZfaZfh_coverage.svh" @@ -22,6 +29,18 @@ `include "RV64ZcbZbb_coverage.svh" `include "RV64ZcbZba_coverage.svh" `include "RV64Zcd_coverage.svh" +`include "RV64Zaamo_coverage.svh" +`include "RV64Zalrsc_coverage.svh" +`include "RV64Zknd_coverage.svh" +`include "RV64Zkne_coverage.svh" +`include "RV64Zknh_coverage.svh" + + + + + + + // Privileged extensions `include "RV64VM_coverage.svh" From 9822902a4fbea371954aac8735d667b20baca99a Mon Sep 17 00:00:00 2001 From: naichewa Date: Tue, 5 Nov 2024 11:17:01 -0800 Subject: [PATCH 03/25] Revert "Added SCKMODE 10 and 11 delay cases to regression tests" unwanted submodule changes This reverts commit 38a88862ac05e4eb2513a7314de5260c08359481. --- addins/ahbsdc | 1 - addins/cvw-arch-verif | 2 +- addins/riscv-arch-test | 2 +- .../references/WALLY-spi-01.reference_output | 24 ------ .../rv32i_m/privilege/src/WALLY-spi-01.S | 78 +----------------- .../references/WALLY-spi-01.reference_output | 24 ------ .../rv64i_m/privilege/src/WALLY-spi-01.S | 80 +------------------ 7 files changed, 5 insertions(+), 206 deletions(-) delete mode 160000 addins/ahbsdc diff --git a/addins/ahbsdc b/addins/ahbsdc deleted file mode 160000 index 33418c8dc..000000000 --- a/addins/ahbsdc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 33418c8dc11baf63e843b0d35f57d22c1e3182e3 diff --git a/addins/cvw-arch-verif b/addins/cvw-arch-verif index 189974e49..6d658b7b4 160000 --- a/addins/cvw-arch-verif +++ b/addins/cvw-arch-verif @@ -1 +1 @@ -Subproject commit 189974e497d7b8d2c08bb1d151b1ccdeaf3a64c9 +Subproject commit 6d658b7b42c83fd584008d72964cc75d0876b769 diff --git a/addins/riscv-arch-test b/addins/riscv-arch-test index 7152865ac..3843c736e 160000 --- a/addins/riscv-arch-test +++ b/addins/riscv-arch-test @@ -1 +1 @@ -Subproject commit 7152865aca51062c87ff2cbb014e199a24bdc874 +Subproject commit 3843c736e427a2b52a0d06e6220b073afa4be401 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output index e19f75391..027e02f54 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,30 +146,6 @@ 00000015 -00000010 - -00000010 - -00000010 - -00000010 - -00000010 - -00000010 - -00000011 - -00000011 - -00000011 - -00000011 - -00000011 - -00000011 - 00000011 #delay1 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S index 19b70829c..94defaf87 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S @@ -316,87 +316,11 @@ test_cases: .4byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .4byte rx_data, 0x00000015, read32_test # read rx_data -# SCKCS Delay of 0, SCKMODE 10 -.4byte sck_mode, 0x00000002, write32_test #set sckmode to 10 -.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - -# Arbitrary SCKCS delay, SCKMODE 10 -.4byte delay0, 0x00050001, write32_test # set sckcs delay to 5 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - -# Long SCKCS delay, SCKMODE 10 -.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - -# CSSCK Delay 0, SCKMODE 10 -.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - -# Arbitrary CSSCK delay, SCKMODE 10 -.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - -# Long CSSCK delay, SCKMODE 10 -.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000010, read32_test # reade rx_data - - - -# SCKCS Delay of 0, SCKMODE 11 -.4byte sck_mode, 0x00000003, write32_test -.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - -# Arbitrary SCKCS delay, SCKMODE 11 -.4byte delay0, 0x00050001, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - -# Long SCKCS delay, SCKMODE 11 -.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - -# CSSCK Delay 0, SCKMODE 11 -.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - -# Arbitrary CSSCK delay, SCKMODE 11 -.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - -# Long CSSCK delay, SCKMODE 11 -.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 -.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.4byte rx_data, 0x00000011, read32_test # reade rx_data - # =========== Test delay1 register =========== # Test inter cs delay -.4byte sck_mode, 0x00000000, write32_test #reset sck_mode + .4byte delay0, 0x00010001, write32_test # reset delay0 register .4byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .4byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output index bc17f4beb..8d9ae8bbc 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,30 +146,6 @@ 00000000 00000015 00000000 -00000010 -00000000 -00000010 -00000000 -00000010 -00000000 -00000010 -00000000 -00000010 -00000000 -00000010 -00000000 -00000011 -00000000 -00000011 -00000000 -00000011 -00000000 -00000011 -00000000 -00000011 -00000000 -00000011 -00000000 00000011 #delay1 00000000 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S index a31069470..23cfd169a 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S @@ -258,7 +258,7 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000011, read32_test # read rx_data -# =========== Test delay0 register (mode auto)=========== +# =========== Test delay0 register =========== # Test cs-sck delay of 0 with sck phase = 0 (implicit half cycle delay) @@ -320,87 +320,11 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000015, read32_test # read rx_data -# SCKCS Delay of 0, SCKMODE 10 -.8byte sck_mode, 0x00000002, write32_test #set sckmode to 10 -.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - -# Arbitrary SCKCS delay, SCKMODE 10 -.8byte delay0, 0x00050001, write32_test # set sckcs delay to 5 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - -# Long SCKCS delay, SCKMODE 10 -.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - -# CSSCK Delay 0, SCKMODE 10 -.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - -# Arbitrary CSSCK delay, SCKMODE 10 -.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - -# Long CSSCK delay, SCKMODE 10 -.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000010, read32_test # reade rx_data - - - -# SCKCS Delay of 0, SCKMODE 11 -.8byte sck_mode, 0x00000003, write32_test -.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - -# Arbitrary SCKCS delay, SCKMODE 11 -.8byte delay0, 0x00050001, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - -# Long SCKCS delay, SCKMODE 11 -.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - -# CSSCK Delay 0, SCKMODE 11 -.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - -# Arbitrary CSSCK delay, SCKMODE 11 -.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - -# Long CSSCK delay, SCKMODE 11 -.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 -.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data -.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission -.8byte rx_data, 0x00000011, read32_test # reade rx_data - # =========== Test delay1 register =========== # Test inter cs delay -.8byte sck_mode, 0x00000000, write32_test #reset sck_mode + .8byte delay0, 0x00010001, write32_test # reset delay0 register .8byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .8byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock From 73c216575664c4c28048d6bcf531bb46455bb57f Mon Sep 17 00:00:00 2001 From: naichewa Date: Tue, 5 Nov 2024 11:30:13 -0800 Subject: [PATCH 04/25] recommit sckmode 10 11 delay regression tests --- addins/ahbsdc | 1 + .../references/WALLY-spi-01.reference_output | 24 ++++++ .../rv32i_m/privilege/src/WALLY-spi-01.S | 78 +++++++++++++++++- .../references/WALLY-spi-01.reference_output | 24 ++++++ .../rv64i_m/privilege/src/WALLY-spi-01.S | 80 ++++++++++++++++++- 5 files changed, 204 insertions(+), 3 deletions(-) create mode 160000 addins/ahbsdc diff --git a/addins/ahbsdc b/addins/ahbsdc new file mode 160000 index 000000000..33418c8dc --- /dev/null +++ b/addins/ahbsdc @@ -0,0 +1 @@ +Subproject commit 33418c8dc11baf63e843b0d35f57d22c1e3182e3 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output index 027e02f54..e19f75391 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,6 +146,30 @@ 00000015 +00000010 + +00000010 + +00000010 + +00000010 + +00000010 + +00000010 + +00000011 + +00000011 + +00000011 + +00000011 + +00000011 + +00000011 + 00000011 #delay1 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S index 94defaf87..19b70829c 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv32i_m/privilege/src/WALLY-spi-01.S @@ -316,11 +316,87 @@ test_cases: .4byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .4byte rx_data, 0x00000015, read32_test # read rx_data +# SCKCS Delay of 0, SCKMODE 10 +.4byte sck_mode, 0x00000002, write32_test #set sckmode to 10 +.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 10 +.4byte delay0, 0x00050001, write32_test # set sckcs delay to 5 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 10 +.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 10 +.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 10 +.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 10 +.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000010, read32_test # reade rx_data + + + +# SCKCS Delay of 0, SCKMODE 11 +.4byte sck_mode, 0x00000003, write32_test +.4byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 11 +.4byte delay0, 0x00050001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 11 +.4byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 11 +.4byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 11 +.4byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 11 +.4byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.4byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.4byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.4byte rx_data, 0x00000011, read32_test # reade rx_data + # =========== Test delay1 register =========== # Test inter cs delay - +.4byte sck_mode, 0x00000000, write32_test #reset sck_mode .4byte delay0, 0x00010001, write32_test # reset delay0 register .4byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .4byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output index 8d9ae8bbc..bc17f4beb 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/references/WALLY-spi-01.reference_output @@ -146,6 +146,30 @@ 00000000 00000015 00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000010 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 +00000011 +00000000 00000011 #delay1 00000000 00000022 diff --git a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S index 23cfd169a..a31069470 100644 --- a/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S +++ b/tests/wally-riscv-arch-test/riscv-test-suite/rv64i_m/privilege/src/WALLY-spi-01.S @@ -258,7 +258,7 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000011, read32_test # read rx_data -# =========== Test delay0 register =========== +# =========== Test delay0 register (mode auto)=========== # Test cs-sck delay of 0 with sck phase = 0 (implicit half cycle delay) @@ -320,11 +320,87 @@ test_cases: .8byte 0x0, 0x00000000, spi_data_wait # wait for transmission to end .8byte rx_data, 0x00000015, read32_test # read rx_data +# SCKCS Delay of 0, SCKMODE 10 +.8byte sck_mode, 0x00000002, write32_test #set sckmode to 10 +.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 10 +.8byte delay0, 0x00050001, write32_test # set sckcs delay to 5 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 10 +.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 10 +.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 10 +.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 10 +.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000010, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000010, read32_test # reade rx_data + + + +# SCKCS Delay of 0, SCKMODE 11 +.8byte sck_mode, 0x00000003, write32_test +.8byte delay0, 0x00000001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary SCKCS delay, SCKMODE 11 +.8byte delay0, 0x00050001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long SCKCS delay, SCKMODE 11 +.8byte delay0, 0x00A50001, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# CSSCK Delay 0, SCKMODE 11 +.8byte delay0, 0x00010000, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Arbitrary CSSCK delay, SCKMODE 11 +.8byte delay0, 0x00010005, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + +# Long CSSCK delay, SCKMODE 11 +.8byte delay0, 0x000100A5, write32_test # set sckcs delay to 0 +.8byte tx_data, 0x00000011, write32_test # place 10 into tx_data +.8byte 0x0, 0x00000000, spi_data_wait #wait for transmission +.8byte rx_data, 0x00000011, read32_test # reade rx_data + # =========== Test delay1 register =========== # Test inter cs delay - +.8byte sck_mode, 0x00000000, write32_test #reset sck_mode .8byte delay0, 0x00010001, write32_test # reset delay0 register .8byte delay1, 0x00000005, write32_test # set inter_cs delay to 5 .8byte rx_mark, 0x0000003, write32_test # preset rx watermark b/c of hardware interlock From d899a84a011341d90abc4871b24d824d835bfeda Mon Sep 17 00:00:00 2001 From: naichewa Date: Tue, 5 Nov 2024 11:41:58 -0800 Subject: [PATCH 05/25] submodule fix --- addins/ahbsdc | 1 - 1 file changed, 1 deletion(-) delete mode 160000 addins/ahbsdc diff --git a/addins/ahbsdc b/addins/ahbsdc deleted file mode 160000 index 33418c8dc..000000000 --- a/addins/ahbsdc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 33418c8dc11baf63e843b0d35f57d22c1e3182e3 From ff8ea2adfdbb9c5c7f3375a5763a6e97af864870 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 7 Nov 2024 07:58:54 -0800 Subject: [PATCH 06/25] Removed unused TLB code coverage --- tests/coverage/tlbKP.S | 144 ------------------------------------- tests/coverage/tlbM3.S | 156 ----------------------------------------- 2 files changed, 300 deletions(-) delete mode 100644 tests/coverage/tlbKP.S delete mode 100644 tests/coverage/tlbM3.S diff --git a/tests/coverage/tlbKP.S b/tests/coverage/tlbKP.S deleted file mode 100644 index ca72a16db..000000000 --- a/tests/coverage/tlbKP.S +++ /dev/null @@ -1,144 +0,0 @@ -/////////////////////////////////////////// -// lsu_test.S -// -// Written: mmendozamanriquez@hmc.edu 4 April 2023 -// nlimpert@hmc.edu -// -// Purpose: Test coverage for LSU -// -// A component of the CORE-V-WALLY configurable RISC-V project. -// https://github.com/openhwgroup/cvw -// -// Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University -// -// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 -// -// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file -// except in compliance with the License, or, at your option, the Apache License version 2.0. You -// may obtain a copy of the License at -// -// https://solderpad.org/licenses/SHL-2.1/ -// -// Unless required by applicable law or agreed to in writing, any work distributed under the -// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. -//////////////////////////////////////////////////////////////////////////////////////////////// - -// load code to initalize stack, handle interrupts, terminate - -#include "WALLY-init-lib.h" - -# run-elf.bash find this in project description -main: - # Page table root address at 0x80010000 - li t5, 0x9000000000080010 - csrw satp, t5 - - # sfence.vma x0, x0 - - # switch to supervisor mode - li a0, 1 - ecall - - li t0, 0x80015000 - - li t2, 0 # i = 0 - li t3, 33 # Max amount of Loops = 32 - -loop: bge t2, t3, finished # exit loop if i >= loops - lw t1, 0(t0) - li t4, 0x1000 - add t0, t0, t4 - addi t2, t2, 1 - j loop - -finished: - j done - -.data - -.align 16 -# Page table situated at 0x80010000 -pagetable: - .8byte 0x200044C1 // old page table was 200040 which just pointed to itself! wrong - -.align 12 - .8byte 0x0000000000000000 - .8byte 0x00000000200048C1 - .8byte 0x00000000200048C1 - - -.align 12 - .8byte 0x0000000020004CC1 - //.8byte 0x00000200800CF// ADD IN THE MEGAPAGE should 3 nibbles of zeros be removed? - -.align 12 - #80000000 - .8byte 0x200000CF - .8byte 0x200004CF - .8byte 0x200008CF - .8byte 0x20000CCF - - .8byte 0x200010CF - .8byte 0x200014CF - .8byte 0x200018CF - .8byte 0x20001CCF - - .8byte 0x200020CF - .8byte 0x200024CF - .8byte 0x200028CF - .8byte 0x20002CCF - - .8byte 0x200030CF - .8byte 0x200034CF - .8byte 0x200038CF - .8byte 0x20003CCF - - .8byte 0x200040CF - .8byte 0x200044CF - .8byte 0x200048CF - .8byte 0x20004CCF - - .8byte 0x200050CF - .8byte 0x200054CF - .8byte 0x200058CF - .8byte 0x20005CCF - - .8byte 0x200060CF - .8byte 0x200064CF - .8byte 0x200068CF - .8byte 0x20006CCF - - .8byte 0x200070CF - .8byte 0x200074CF - .8byte 0x200078CF - .8byte 0x20007CCF - - .8byte 0x200080CF - .8byte 0x200084CF - .8byte 0x200088CF - .8byte 0x20008CCF - - .8byte 0x200090CF - .8byte 0x200094CF - .8byte 0x200098CF - .8byte 0x20009CCF - - .8byte 0x200100CF - .8byte 0x200104CF - .8byte 0x200108CF - .8byte 0x20010CCF - - .8byte 0x200110CF - .8byte 0x200114CF - .8byte 0x200118CF - .8byte 0x20011CCF - - .8byte 0x200120CF - .8byte 0x200124CF - .8byte 0x200128CF - .8byte 0x20012CCF - - .8byte 0x200130CF - .8byte 0x200134CF diff --git a/tests/coverage/tlbM3.S b/tests/coverage/tlbM3.S deleted file mode 100644 index 986fb378a..000000000 --- a/tests/coverage/tlbM3.S +++ /dev/null @@ -1,156 +0,0 @@ -/////////////////////////////////////////// -// tlbKP.S -// -// Written: mmendozamanriquez@hmc.edu 4 April 2023 -// nlimpert@hmc.edu -// -// Purpose: Test coverage for LSU -// -// A component of the CORE-V-WALLY configurable RISC-V project. -// https://github.com/openhwgroup/cvw -// -// Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University -// -// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 -// -// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file -// except in compliance with the License, or, at your option, the Apache License version 2.0. You -// may obtain a copy of the License at -// -// https://solderpad.org/licenses/SHL-2.1/ -// -// Unless required by applicable law or agreed to in writing, any work distributed under the -// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. -//////////////////////////////////////////////////////////////////////////////////////////////// - -// load code to initalize stack, handle interrupts, terminate - -#include "WALLY-init-lib.h" - -# run-elf.bash find this in project description -main: - # Page table root address at 0x80010000 - li t5, 0x9000000000080010 - csrw satp, t5 - - # sfence.vma x0, x0 - - # switch to supervisor mode - li a0, 1 - ecall - - li t0, 0x1000 - - li t2, 0 # i = 0 - li t3, 64 # Max amount of Loops = 32 - li t4, 0x1000 - -loop: bge t2, t3, interim # exit loop if i >= loops - lw t1, 0(t0) - # sfence.vma x0, x0 - add t0, t0, t4 - addi t2, t2, 1 - j loop - -interim: - li t0, 0xFFFFFFFF000 - li t2, 0 # i = 0 - - -loop2:bge t2, t3, finished # exit loop if i >= loops - lw t1, 0(t0) - add t0, t0, t4 - addi t2, t2, 1 - j loop2 - -finished: - j done - -.data - -.align 16 -# Page table situated at 0x80010000 -pagetable: - .8byte 0x200044C1 // old page table was 200040 which just pointed to itself! wrong - -.align 12 - .8byte 0x00000000200048C1 - .8byte 0x00000000200048C1 - .8byte 0x00000000200048C1 - - -.align 12 - .8byte 0x0000000020004CC1 - //.8byte 0x00000200800CF// ADD IN THE MEGAPAGE should 3 nibbles of zeros be removed? - -.align 12 - #80000000 - .8byte 0x200000CF - .8byte 0x200004CF - .8byte 0x200008CF - .8byte 0x20000CCF - - .8byte 0x200010CF - .8byte 0x200014CF - .8byte 0x200018CF - .8byte 0x20001CCF - - .8byte 0x200020CF - .8byte 0x200024CF - .8byte 0x200028CF - .8byte 0x20002CCF - - .8byte 0x200030CF - .8byte 0x200034CF - .8byte 0x200038CF - .8byte 0x20003CCF - - .8byte 0x200040CF - .8byte 0x200044CF - .8byte 0x200048CF - .8byte 0x20004CCF - - .8byte 0x200050CF - .8byte 0x200054CF - .8byte 0x200058CF - .8byte 0x20005CCF - - .8byte 0x200060CF - .8byte 0x200064CF - .8byte 0x200068CF - .8byte 0x20006CCF - - .8byte 0x200070CF - .8byte 0x200074CF - .8byte 0x200078CF - .8byte 0x20007CCF - - .8byte 0x200080CF - .8byte 0x200084CF - .8byte 0x200088CF - .8byte 0x20008CCF - - .8byte 0x200090CF - .8byte 0x200094CF - .8byte 0x200098CF - .8byte 0x20009CCF - - .8byte 0x2000A0CF - .8byte 0x2000A4CF - .8byte 0x2000A8CF - .8byte 0x2000ACCF - - .8byte 0x2000B0CF - .8byte 0x2000B4CF - .8byte 0x2000B8CF - .8byte 0x2000BCCF - - .8byte 0x2000C0CF - .8byte 0x2000C4CF - .8byte 0x2000C8CF - .8byte 0x2000CCCF - - .8byte 0x2000D0CF - .8byte 0x2000D4CF From 927398a017ede9eee0b2f9d27e5f924577dbfa30 Mon Sep 17 00:00:00 2001 From: naichewa Date: Thu, 7 Nov 2024 10:17:22 -0800 Subject: [PATCH 07/25] Fix SPI state skipping sck-cs delay when at end of transmission --- src/uncore/spi_controller.sv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uncore/spi_controller.sv b/src/uncore/spi_controller.sv index 37c1e3ac9..a0aab008a 100644 --- a/src/uncore/spi_controller.sv +++ b/src/uncore/spi_controller.sv @@ -263,8 +263,9 @@ module spi_controller ( TRANSMIT: begin // TRANSMIT case -------------------------------- case(CSMode) AUTOMODE: begin - if (EndTransmission) NextState = INACTIVE; - else if (EndOfFrame) NextState = SCKCS; + if (EndTransmission & ~HasSCKCS) NextState = INACTIVE; + else if (EndOfFrame & HasSCKCS) NextState = SCKCS; + else if (EndOfFrame & ~HasSCKCS) NextState = INTERCS; else NextState = TRANSMIT; end HOLDMODE: begin From 7637f3e33b99e5d8e2404f7f9f5b90d71433de81 Mon Sep 17 00:00:00 2001 From: naichewa Date: Thu, 7 Nov 2024 10:19:55 -0800 Subject: [PATCH 08/25] Fix erroneous implicit sckcs and cssck phase delays --- src/uncore/spi_controller.sv | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/uncore/spi_controller.sv b/src/uncore/spi_controller.sv index a0aab008a..7a5126f2c 100644 --- a/src/uncore/spi_controller.sv +++ b/src/uncore/spi_controller.sv @@ -93,6 +93,7 @@ module spi_controller ( logic [7:0] sckcs; logic [7:0] intercs; logic [7:0] interxfr; + logic Phase; logic HasCSSCK; logic HasSCKCS; @@ -142,6 +143,7 @@ module spi_controller ( assign ContinueTransmit = ~TransmitFIFOEmpty & EndOfFrame; assign EndTransmission = TransmitFIFOEmpty & EndOfFrame; + assign Phase = SckMode[0]; always_ff @(posedge PCLK) begin if (~PRESETn) begin @@ -166,10 +168,12 @@ module spi_controller ( end // SPICLK Logic + if (TransmitStart) begin SPICLK <= SckMode[1]; - end else if (SCLKenable & Transmitting) begin - SPICLK <= (~EndTransmission & ~DelayIsNext) ? ~SPICLK : SckMode[1]; + end else if (SCLKenable) begin + if (Phase & (NextState == TRANSMIT)) SPICLK <= (~EndTransmission & ~DelayIsNext) ? ~SPICLK : SckMode[1]; + else if (Transmitting) SPICLK <= (~EndTransmission & ~DelayIsNext) ? ~SPICLK : SckMode[1]; end // Reset divider From 79643586515878de143d1667d1e12c53210bf358 Mon Sep 17 00:00:00 2001 From: naichewa Date: Thu, 7 Nov 2024 10:47:51 -0800 Subject: [PATCH 09/25] Fix erroneous implicit sckcs and cssck phase delays --- src/uncore/spi_controller.sv | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/src/uncore/spi_controller.sv b/src/uncore/spi_controller.sv index 7a5126f2c..77cad340f 100644 --- a/src/uncore/spi_controller.sv +++ b/src/uncore/spi_controller.sv @@ -75,7 +75,6 @@ module spi_controller ( logic ShiftEdgePulse; logic SampleEdgePulse; logic EndOfFramePulse; - logic PhaseOneOffset; // Frame stuff logic [3:0] BitNum; @@ -212,35 +211,18 @@ module spi_controller ( always_ff @(posedge ~PCLK) begin if (~PRESETn | TransmitStart) begin ShiftEdge <= 0; - PhaseOneOffset <= 0; SampleEdge <= 0; EndOfFrame <= 0; - end else begin - PhaseOneOffset <= (PhaseOneOffset == 0) ? Transmitting & SCLKenable : ~EndOfFrame; - case(SckMode) - 2'b00: begin - ShiftEdge <= SPICLK & ShiftEdgePulse; - SampleEdge <= ~SPICLK & SampleEdgePulse; - EndOfFrame <= SPICLK & EndOfFramePulse; - end - 2'b01: begin - ShiftEdge <= ~SPICLK & ShiftEdgePulse & PhaseOneOffset; - SampleEdge <= SPICLK & SampleEdgePulse; - EndOfFrame <= ~SPICLK & EndOfFramePulse; - end - 2'b10: begin + end else if (^SckMode) begin ShiftEdge <= ~SPICLK & ShiftEdgePulse; SampleEdge <= SPICLK & SampleEdgePulse; EndOfFrame <= ~SPICLK & EndOfFramePulse; - end - 2'b11: begin - ShiftEdge <= SPICLK & ShiftEdgePulse & PhaseOneOffset; + end else begin + ShiftEdge <= SPICLK & ShiftEdgePulse; SampleEdge <= ~SPICLK & SampleEdgePulse; EndOfFrame <= SPICLK & EndOfFramePulse; - end - endcase - end - end + end + end // Logic for continuing to transmit through Delay states after end of frame assign NextEndDelay = NextState == SCKCS | NextState == INTERCS | NextState == INTERXFR; From 987015a2a707068576af5b3bad3675f177e40384 Mon Sep 17 00:00:00 2001 From: naichewa Date: Thu, 7 Nov 2024 12:14:23 -0800 Subject: [PATCH 10/25] Fix SPI Delay1 behavior --- src/uncore/spi_controller.sv | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/uncore/spi_controller.sv b/src/uncore/spi_controller.sv index 77cad340f..939457954 100644 --- a/src/uncore/spi_controller.sv +++ b/src/uncore/spi_controller.sv @@ -162,7 +162,7 @@ module spi_controller ( // Counter for all four delay types if (DelayState & SCK & SCLKenable) begin DelayCounter <= DelayCounter + 8'd1; - end else if (SCLKenable & EndOfDelay) begin + end else if ((SCLKenable & EndOfDelay) | Transmitting) begin DelayCounter <= 8'd0; end @@ -255,13 +255,13 @@ module spi_controller ( else NextState = TRANSMIT; end HOLDMODE: begin - if (EndTransmission) NextState = HOLD; - else if (ContinueTransmit & HasINTERXFR) NextState = INTERXFR; + if (EndOfFrame & HasINTERXFR) NextState = INTERXFR; + else if (EndTransmission) NextState = HOLD; else NextState = TRANSMIT; end OFFMODE: begin - if (EndTransmission) NextState = INACTIVE; - else if (ContinueTransmit & HasINTERXFR) NextState = INTERXFR; + if (EndOfFrame & HasINTERXFR) NextState = INTERXFR; + else if (EndTransmission) NextState = HOLD; else NextState = TRANSMIT; end default: NextState = TRANSMIT; @@ -269,14 +269,7 @@ module spi_controller ( end SCKCS: begin // SCKCS case -------------------------------------- if (EndOfSCKCS) begin - if (~TransmitRegLoaded) begin - // if (CSMode == AUTOMODE) NextState = INACTIVE; - if (CSMode == HOLDMODE) NextState = HOLD; - else NextState = INACTIVE; - end else begin - if (HasINTERCS) NextState = INTERCS; - else NextState = TRANSMIT; - end + NextState = INTERCS; end else begin NextState = SCKCS; end @@ -290,15 +283,18 @@ module spi_controller ( end INTERCS: begin // INTERCS case ---------------------------------- if (EndOfINTERCS) begin - if (HasCSSCK) NextState = CSSCK; - else NextState = TRANSMIT; + if (TransmitRegLoaded) begin + if (HasCSSCK) NextState = CSSCK; + else NextState = TRANSMIT; + end else NextState = INACTIVE; end else begin NextState = INTERCS; end end INTERXFR: begin // INTERXFR case -------------------------------- if (EndOfINTERXFR) begin - NextState = TRANSMIT; + if (TransmitRegLoaded) NextState = TRANSMIT; + else NextState = HOLD; end else begin NextState = INTERXFR; end From 85404bbc5b1554aa615fdff2653d6055842db24b Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Wed, 6 Nov 2024 14:50:15 -0800 Subject: [PATCH 11/25] Cover write to TIME CSR --- tests/coverage/csrwrites.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/coverage/csrwrites.S b/tests/coverage/csrwrites.S index fb5cfd436..ef0c283ec 100644 --- a/tests/coverage/csrwrites.S +++ b/tests/coverage/csrwrites.S @@ -38,6 +38,9 @@ main: csrrw t1, menvcfg, t0 csrrw t2, senvcfg, t0 + # Test writing to TIME CSR + csrw time, zero + # testing FIOM with different privilege modes # setting environment config (to both 1 and 0) in each privilege mode csrsi menvcfg, 1 From 4a14f8052766fdd27eca1e485ab83860609d5357 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Wed, 6 Nov 2024 15:23:34 -0800 Subject: [PATCH 12/25] Refactor coverage tests to use assembly instead of machine code where possible --- tests/coverage/Makefile | 2 +- tests/coverage/ifu.S | 34 +++++++++++----------------------- tests/coverage/priv.S | 2 +- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/tests/coverage/Makefile b/tests/coverage/Makefile index 63b605679..7e68c28c0 100644 --- a/tests/coverage/Makefile +++ b/tests/coverage/Makefile @@ -28,7 +28,7 @@ all: $(OBJDUMPS) $(MEMFILES) # Assemble into object files %.$(OBJEXT): %.$(AEXT) - riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $< + riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zcb_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh_svinval -mabi=lp64 $< # Preprocess assembly files %.$(AEXT): %.$(SRCEXT) WALLY-init-lib.h diff --git a/tests/coverage/ifu.S b/tests/coverage/ifu.S index 72c515287..eaceb71ce 100644 --- a/tests/coverage/ifu.S +++ b/tests/coverage/ifu.S @@ -43,35 +43,23 @@ main: .hword 0x9C41 // line 134 Illegal compressed instruction # Zcb coverage tests - # could restore assembly language versions when GCC supports Zcb mv s0, sp - #c.lbu s1, 0(s0) // exercise c.lbu - .hword 0x8004 // c.lbu s1, 0(s0) - #c.lh s1, 0(s0) // exercise c.lh - .hword 0x8444 // c.lh s1, 0(s0) - #c.lhu s1, 0(s0) // exercise c.lhu - .hword 0x8404 // c.lhu s1, 0(s0) - #c.sb s1, 0(s0) // exercise c.sb - .hword 0x8804 // c.sb s1, 0(s0) - #c.sh s1, 0(s0) // exercise c.sh - .hword 0x8C04 // c.sh s1, 0(s0) + c.lbu s1, 0(s0) // exercise c.lbu + c.lh s1, 0(s0) // exercise c.lh + c.lhu s1, 0(s0) // exercise c.lhu + c.sb s1, 0(s0) // exercise c.sb + c.sh s1, 0(s0) // exercise c.sh .hword 0x8C44 // Illegal compressed instruction with op = 00, Instr[15:10] = 100011, Instr[6] = 1 and 0's everywhere else. Line 119 illegal instruction .hword 0x9C00 // Illegal compressed instruction with op = 00, Instr[15:10] = 100111, and 0's everywhere else. Line 119 illegal instruction li s0, 0xFF - # c.zext.b s0 // exercise c.zext.b - .hword 0x9C61 // c.zext.b s0 - # c.sext.b s0 // exercise c.sext.b - .hword 0x9C65 // c.sext.b s0 - # c.zext.h s0 // exercise c.zext.h - .hword 0x9C69 // c.zext.h s0 - # c.sext.h s0 // exercise c.sext.h - .hword 0x9C6D // c.sext.h s0 - # c.zext.w s0 // exercise c.zext.w - .hword 0x9C71 // c.zext.w s0 - # c.not s0 // exercise c.not - .hword 0x9C75 // c.not s0 + c.zext.b s0 // exercise c.zext.b + c.sext.b s0 // exercise c.sext.b + c.zext.h s0 // exercise c.zext.h + c.sext.h s0 // exercise c.sext.h + c.zext.w s0 // exercise c.zext.w + c.not s0 // exercise c.not .hword 0x9C7D // Reserved instruction from line 187 with op = 01, Instr[15:10] = 100111, Instr[6:5] = 11, and 0's everywhere else diff --git a/tests/coverage/priv.S b/tests/coverage/priv.S index 1af15add7..d0d3f94f4 100644 --- a/tests/coverage/priv.S +++ b/tests/coverage/priv.S @@ -304,7 +304,7 @@ sretdone: li a0, 3 ecall # exercise sfence.inval.ir instruction - .word 0x18100073 + sfence.inval.ir # exercise sret with rs1 not 0 .word 0x102F8073 From 040d6269b53d26b1c19ad11fcc904097eb4c661b Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Wed, 6 Nov 2024 18:08:25 -0800 Subject: [PATCH 13/25] cover illegal aes64ksli1 instruction --- tests/coverage/ieu.S | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/coverage/ieu.S b/tests/coverage/ieu.S index 43e7b6604..285a170cb 100644 --- a/tests/coverage/ieu.S +++ b/tests/coverage/ieu.S @@ -81,6 +81,7 @@ main: .word 0xFF00302F // illegal Atomic instruction .word 0xFF00402F // illegal Atomic instruction .word 0x00000873 // illegal CSR instruction + .word 0x31bf1f93 // illegal aes64ksli1 instruction # Illegal CMO instructions because envcfg is 0 and system is in user Mode li a0, 0 From 6f496e0b9307e154884d978cdb4bc37f9405eb89 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Thu, 7 Nov 2024 13:40:07 -0800 Subject: [PATCH 14/25] Remove unused fround coverage test --- tests/coverage/fround.S | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 tests/coverage/fround.S diff --git a/tests/coverage/fround.S b/tests/coverage/fround.S deleted file mode 100644 index 7d469d773..000000000 --- a/tests/coverage/fround.S +++ /dev/null @@ -1,18 +0,0 @@ -// fround.s - -#include "WALLY-init-lib.h" - -# run-elf.bash find this in project description -main: - - bseti t0, zero, 14 # turn on FPU - csrs mstatus, t0 - - # test fround behavior on NaN - li t0, 0x7FC00001 - fmv.w.x ft0, t0 - fround.s ft1, ft0 - j done - -.align 10 -data_start: From e57473ece17715a1821837071f45eb16dc4c9230 Mon Sep 17 00:00:00 2001 From: Mike Kuskov Date: Fri, 8 Nov 2024 02:23:44 +0300 Subject: [PATCH 15/25] Fix minor typos in `src/fpu/postproc` --- src/fpu/postproc/postprocess.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fpu/postproc/postprocess.sv b/src/fpu/postproc/postprocess.sv index f4f7c2b5b..3674303eb 100644 --- a/src/fpu/postproc/postprocess.sv +++ b/src/fpu/postproc/postprocess.sv @@ -46,14 +46,14 @@ module postprocess import cvw::*; #(parameter cvw_t P) ( input logic [P.NE+1:0] FmaSe, // the sum's exponent input logic [P.FMALEN-1:0] FmaSm, // the positive sum input logic FmaASticky, // sticky bit that is calculated during alignment - input logic [$clog2(P.FMALEN+1)-1:0] FmaSCnt, // the normalization shift count + input logic [$clog2(P.FMALEN+1)-1:0] FmaSCnt, // the normalization shift count //divide signals input logic DivSticky, // divider sticky bit input logic [P.NE+1:0] DivUe, // divsqrt exponent input logic [P.DIVb:0] DivUm, // divsqrt significand // conversion signals input logic CvtCs, // the result's sign - input logic [P.NE:0] CvtCe, // the calculated expoent + input logic [P.NE:0] CvtCe, // the calculated exponent input logic CvtResSubnormUf, // the convert result is subnormal or underflows input logic [P.LOGCVTLEN-1:0] CvtShiftAmt, // how much to shift by input logic ToInt, // is fp->int (since it's writting to the integer register) From 18ddf1f77b7bafe8831532efa833d392d46d9b32 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:04:09 -0800 Subject: [PATCH 16/25] Revert "Enabling ZB and Zk extensions in coverage.svh of congif/rv32gc and congif/rv64gc" --- config/rv32gc/coverage.svh | 12 ------------ config/rv64gc/coverage.svh | 19 ------------------- 2 files changed, 31 deletions(-) diff --git a/config/rv32gc/coverage.svh b/config/rv32gc/coverage.svh index eed513f9f..97496a8b9 100644 --- a/config/rv32gc/coverage.svh +++ b/config/rv32gc/coverage.svh @@ -10,13 +10,6 @@ `include "RV32M_coverage.svh" `include "RV32F_coverage.svh" `include "RV32D_coverage.svh" -`include "RV32Zba_coverage.svh" -`include "RV32Zbb_coverage.svh" -`include "RV32Zbc_coverage.svh" -`include "RV32Zbs_coverage.svh" -`include "RV32Zbkb_coverage.svh" -`include "RV32Zbkc_coverage.svh" -`include "RV32Zbkx_coverage.svh" `include "RV32ZfaF_coverage.svh" `include "RV32ZfaD_coverage.svh" `include "RV32ZfaZfh_coverage.svh" @@ -29,11 +22,6 @@ `include "RV32ZcbZbb_coverage.svh" `include "RV32Zcf_coverage.svh" `include "RV32Zcd_coverage.svh" -`include "RV32Zaamo_coverage.svh" -`include "RV32Zalrsc_coverage.svh" -`include "RV32Zknd_coverage.svh" -`include "RV32Zkne_coverage.svh" -`include "RV32Zknh_coverage.svh" // Privileged extensions `include "ZicsrM_coverage.svh" diff --git a/config/rv64gc/coverage.svh b/config/rv64gc/coverage.svh index a293eb5b1..d594a3a44 100644 --- a/config/rv64gc/coverage.svh +++ b/config/rv64gc/coverage.svh @@ -10,13 +10,6 @@ `include "RV64M_coverage.svh" `include "RV64F_coverage.svh" `include "RV64D_coverage.svh" -`include "RV64Zba_coverage.svh" -`include "RV64Zbb_coverage.svh" -`include "RV64Zbc_coverage.svh" -`include "RV64Zbs_coverage.svh" -`include "RV64Zbkb_coverage.svh" -`include "RV64Zbkc_coverage.svh" -`include "RV64Zbkx_coverage.svh" `include "RV64ZfaF_coverage.svh" `include "RV32ZfaD_coverage.svh" `include "RV32ZfaZfh_coverage.svh" @@ -29,18 +22,6 @@ `include "RV64ZcbZbb_coverage.svh" `include "RV64ZcbZba_coverage.svh" `include "RV64Zcd_coverage.svh" -`include "RV64Zaamo_coverage.svh" -`include "RV64Zalrsc_coverage.svh" -`include "RV64Zknd_coverage.svh" -`include "RV64Zkne_coverage.svh" -`include "RV64Zknh_coverage.svh" - - - - - - - // Privileged extensions `include "RV64VM_coverage.svh" From 83b07a0d27873d81490e5996c09436cd9aed18a3 Mon Sep 17 00:00:00 2001 From: Zain2050 Date: Fri, 8 Nov 2024 07:12:44 -0800 Subject: [PATCH 17/25] enable show_c_prefix --- config/rv32gc/imperas.ic | 1 + config/rv64gc/imperas.ic | 3 +++ 2 files changed, 4 insertions(+) diff --git a/config/rv32gc/imperas.ic b/config/rv32gc/imperas.ic index a4b5fe64c..46d0d31c3 100644 --- a/config/rv32gc/imperas.ic +++ b/config/rv32gc/imperas.ic @@ -71,6 +71,7 @@ --override no_pseudo_inst=T # For code coverage, don't produce pseudoinstructions +--override show_c_prefix=T # Show "c." with compressed instructions # mcause and scause only have 4 lsbs of code and 1 msb of interrupt flag #--override cpu/ecode_mask=0x8000000F # for RV32 diff --git a/config/rv64gc/imperas.ic b/config/rv64gc/imperas.ic index 0ff19fa68..9ba14f2f0 100644 --- a/config/rv64gc/imperas.ic +++ b/config/rv64gc/imperas.ic @@ -70,6 +70,9 @@ # For code coverage, don't produce pseudoinstructions --override no_pseudo_inst=T +# Show "c." with compressed instructions +--override show_c_prefix=T + # nonratified mnosie register not implemented --override cpu/mnoise_undefined=T From 2fe8c4868400c6b329acf1049b6df9ead64bd382 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Fri, 8 Nov 2024 09:32:53 -0800 Subject: [PATCH 18/25] Don't clone QEMU submodules --- bin/wally-tool-chain-install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index f20da4e22..02e1b84a6 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -324,8 +324,7 @@ STATUS="qemu" cd "$RISCV" if git_check "qemu" "https://github.com/qemu/qemu" "$RISCV/include/qemu-plugin.h"; then cd "$RISCV"/qemu - git reset --hard && git clean -f && git checkout master && git pull --recurse-submodules -j "${NUM_THREADS}" - git submodule update --init --recursive + git reset --hard && git clean -f && git checkout master && git pull ./configure --target-list=riscv64-softmmu --prefix="$RISCV" make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] make install 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] From 78fbb0696250c33fc36af0b789307778d4ba5ccf Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Fri, 8 Nov 2024 09:56:49 -0800 Subject: [PATCH 19/25] Fixed Typo --- config/rv64gc/coverage.svh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/rv64gc/coverage.svh b/config/rv64gc/coverage.svh index d594a3a44..d54a342dd 100644 --- a/config/rv64gc/coverage.svh +++ b/config/rv64gc/coverage.svh @@ -11,8 +11,8 @@ `include "RV64F_coverage.svh" `include "RV64D_coverage.svh" `include "RV64ZfaF_coverage.svh" -`include "RV32ZfaD_coverage.svh" -`include "RV32ZfaZfh_coverage.svh" +`include "RV64ZfaD_coverage.svh" +`include "RV64ZfaZfh_coverage.svh" `include "RV64ZfhD_coverage.svh" `include "RV64Zfh_coverage.svh" `include "RV64Zicond_coverage.svh" From 396a17623b070efc276790a2a1faa20f07e528d0 Mon Sep 17 00:00:00 2001 From: naichewa Date: Fri, 8 Nov 2024 11:05:38 -0800 Subject: [PATCH 20/25] Fixed TransmitStart resetting SCK and delay counter while already counting --- src/uncore/spi_controller.sv | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/uncore/spi_controller.sv b/src/uncore/spi_controller.sv index 939457954..dee3d3c99 100644 --- a/src/uncore/spi_controller.sv +++ b/src/uncore/spi_controller.sv @@ -109,7 +109,6 @@ module spi_controller ( logic DelayIsNext; logic DelayState; - // Convenient Delay Reg Names assign cssck = Delay0[7:0]; assign sckcs = Delay0[15:8]; @@ -153,7 +152,7 @@ module spi_controller ( DelayCounter <= 0; end else begin // SCK logic for delay times - if (TransmitStart) begin + if (TransmitStart & ~DelayState) begin SCK <= 0; end else if (SCLKenable) begin SCK <= ~SCK; @@ -168,7 +167,7 @@ module spi_controller ( // SPICLK Logic - if (TransmitStart) begin + if (TransmitStart & ~DelayState) begin SPICLK <= SckMode[1]; end else if (SCLKenable) begin if (Phase & (NextState == TRANSMIT)) SPICLK <= (~EndTransmission & ~DelayIsNext) ? ~SPICLK : SckMode[1]; @@ -176,7 +175,7 @@ module spi_controller ( end // Reset divider - if (SCLKenable | TransmitStart | ResetSCLKenable) begin + if (SCLKenable | (TransmitStart & ~DelayState) | ResetSCLKenable) begin DivCounter <= 12'b0; end else begin DivCounter <= DivCounter + 12'd1; From e4e266fee05d08438844d690c0cba504e793f404 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Fri, 8 Nov 2024 17:20:05 -0800 Subject: [PATCH 21/25] Fix GCC not updated when install script rerun [skip ci] --- bin/wally-tool-chain-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 02e1b84a6..8fe418272 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -276,7 +276,7 @@ cd "$RISCV" # Temporarily pin riscv-gnu-toolchain to use GCC 13.2.0. GCC 14 does not work with the Q extension. if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2"; then cd "$RISCV"/riscv-gnu-toolchain - git reset --hard && git clean -f && git checkout master && git pull + git reset --hard && git clean -f && git checkout master && git pull && git submodule update ./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ] if [ "$clean" ]; then From 80f3b940578b30fa5ecef7de513232c753f54841 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 9 Nov 2024 17:01:34 -0800 Subject: [PATCH 22/25] Replace fixBinMem.c with objcopy --- linux/Makefile | 2 +- .../{testvector-generation => }/genInitMem.sh | 5 ++- linux/testvector-generation/Makefile | 13 -------- linux/testvector-generation/fixBinMem.c | 33 ------------------- 4 files changed, 3 insertions(+), 50 deletions(-) rename linux/{testvector-generation => }/genInitMem.sh (93%) delete mode 100644 linux/testvector-generation/Makefile delete mode 100644 linux/testvector-generation/fixBinMem.c diff --git a/linux/Makefile b/linux/Makefile index b098b0a8b..85ef24ccb 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -60,7 +60,7 @@ install: check_write_permissions check_environment dumptvs: check_write_permissions check_environment $(SUDO) mkdir -p $(RISCV)/linux-testvectors - cd testvector-generation; ./genInitMem.sh + ./genInitMem.sh @echo "Testvectors successfully generated." generate: $(DTB) $(IMAGES) diff --git a/linux/testvector-generation/genInitMem.sh b/linux/genInitMem.sh similarity index 93% rename from linux/testvector-generation/genInitMem.sh rename to linux/genInitMem.sh index 1274a4240..664f7fcfe 100755 --- a/linux/testvector-generation/genInitMem.sh +++ b/linux/genInitMem.sh @@ -46,9 +46,8 @@ echo "Launching QEMU in replay mode!" -ex "q" echo "Changing Endianness" -make fixBinMem -./fixBinMem "$rawRamFile" "$ramFile" -./fixBinMem "$rawBootmemFile" "$bootmemFile" +objcopy --reverse-bytes=8 -F binary "$rawRamFile" "$ramFile" +objcopy --reverse-bytes=8 -F binary "$rawBootmemFile" "$bootmemFile" rm -f "$rawRamFile" "$rawBootmemFile" "$rawUntrimmedBootmemFile" echo "genInitMem.sh completed!" diff --git a/linux/testvector-generation/Makefile b/linux/testvector-generation/Makefile deleted file mode 100644 index c31aae39d..000000000 --- a/linux/testvector-generation/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -SHELL = /bin/sh - -CFLAG = -Wall -g -CC = gcc - -all: fixBinMem - -fixBinMem: fixBinMem.c - ${CC} ${CFLAGS} fixBinMem.c -o fixBinMem - chmod +x fixBinMem - -clean: - -rm -f fixBinMem diff --git a/linux/testvector-generation/fixBinMem.c b/linux/testvector-generation/fixBinMem.c deleted file mode 100644 index fe071008b..000000000 --- a/linux/testvector-generation/fixBinMem.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include -int main(int argc, char *argv[]) { - if (argc < 3){ - fprintf(stderr, "Expected 2 arguments: \n"); - exit(1); - } - char* rawGDBfilePath = argv[1]; - FILE* rawGDBfile; - if ((rawGDBfile = fopen(rawGDBfilePath,"rb"))==NULL) { - fprintf(stderr, "File not found: %s\n",rawGDBfilePath); - exit(1); - } - char* outFilePath = argv[2]; - FILE* outFile = fopen(outFilePath,"w"); - uint64_t qemuWord; - uint64_t verilogWord; - int bytesReturned=0; - do { - bytesReturned=fread(&qemuWord, 8, 1, rawGDBfile); - verilogWord = (((qemuWord>>0 )&0xff)<<56 | - ((qemuWord>>8 )&0xff)<<48 | - ((qemuWord>>16)&0xff)<<40 | - ((qemuWord>>24)&0xff)<<32 | - ((qemuWord>>32)&0xff)<<24 | - ((qemuWord>>40)&0xff)<<16 | - ((qemuWord>>48)&0xff)<<8 | - ((qemuWord>>56)&0xff)<<0); - fwrite(&verilogWord, 8, 1, outFile); - } while(bytesReturned!=0); - return 0; -} From 5bbaf2d95ddcdcc3de160036e369daa1e7613e20 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 9 Nov 2024 17:01:55 -0800 Subject: [PATCH 23/25] Remove bootmem.txt --- linux/bootmem.txt | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 linux/bootmem.txt diff --git a/linux/bootmem.txt b/linux/bootmem.txt deleted file mode 100644 index 7cf7d8453..000000000 --- a/linux/bootmem.txt +++ /dev/null @@ -1,12 +0,0 @@ -00001000: 00000297 auipc t0, 0 # t0 = 0x00001000 -00001004: 02828613 addi a2, t0,0x28 # a2 = 0x00001028 -00001008: f1402573 csrr a0, mhartid # a0 = mhartid -0000100c: 0202b583 ld a1, 32(t0) # a1 = 87000000 - device tree address -00001010: 0182b283 ld t0, 24(t0) # t0 = 80000000 - start of firmware -00001014: 00028067 jr t0 # jump to firmware -00001018: 0000000080000000 # firmware start address -00001020: 000000008fe00000 # flattened device tree load address -00001028: 000000004942534f # a2 points to this 8 dword data structure -00001030: 0000000000000002 -00001038: 0000000080200000 -00001040: 0000000000000001 From 43d0510bc78285ade163003f19401011c30f05ac Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 9 Nov 2024 17:32:43 -0800 Subject: [PATCH 24/25] Pad linux raw testvectors before reversing --- linux/genInitMem.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/genInitMem.sh b/linux/genInitMem.sh index 664f7fcfe..a85837f80 100755 --- a/linux/genInitMem.sh +++ b/linux/genInitMem.sh @@ -46,6 +46,10 @@ echo "Launching QEMU in replay mode!" -ex "q" echo "Changing Endianness" +# Extend files to 8 byte multiple +truncate -s %8 "$rawRamFile" +truncate -s %8 "$rawBootmemFile" +# Reverse bytes objcopy --reverse-bytes=8 -F binary "$rawRamFile" "$ramFile" objcopy --reverse-bytes=8 -F binary "$rawBootmemFile" "$bootmemFile" rm -f "$rawRamFile" "$rawBootmemFile" "$rawUntrimmedBootmemFile" From c776ef3fd4ea4ab8b041e0a35137408a84189888 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 10 Nov 2024 22:20:51 -0800 Subject: [PATCH 25/25] enable assertions in Verilator --- sim/verilator/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/verilator/Makefile b/sim/verilator/Makefile index 326c397de..6a6ad267a 100644 --- a/sim/verilator/Makefile +++ b/sim/verilator/Makefile @@ -6,7 +6,7 @@ SHELL := /bin/bash .PHONY: profile run questa clean # verilator configurations -OPT= +OPT=--assert PARAMS?=--no-trace-top NONPROF?=--stats VERILATOR_DIR=${WALLY}/sim/verilator