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 1/4] 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 553bc0a72d36289a3b6715e6a6aa24894ff277ac Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Tue, 5 Nov 2024 21:08:44 -0800 Subject: [PATCH 2/4] Fix imperas.ic path in wsim --- bin/wsim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/wsim b/bin/wsim index d930277ec..72ec81a22 100755 --- a/bin/wsim +++ b/bin/wsim @@ -90,9 +90,10 @@ else: EnableLog = 0 prefix = "" if (args.lockstep or args.lockstepverbose or args.fcov or args.fcovimp): if (args.sim == "questa" or args.sim == "vcs"): - prefix = "IMPERAS_TOOLS=" + os.path.join(WALLY, "config", args.config, "imperas.ic") - if not os.path.isfile(prefix): # If config is a derivative, look for imperas.ic in derivative configs - prefix = "IMPERAS_TOOLS=" + os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic") + imperasicPath = os.path.join(WALLY, "config", args.config, "imperas.ic") + if not os.path.isfile(imperasicPath): # If config is a derivative, look for imperas.ic in derivative configs + imperasicPath = os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic") + prefix = "IMPERAS_TOOLS=" + imperasicPath # Force Questa to use 64-bit mode, sometimes it defaults to 32-bit even on 64-bit machines if (args.sim == "questa"): prefix = "MTI_VCO_MODE=64 " + prefix From 1570a6338ef4557b8f0d505cfea4c5ad201f17e0 Mon Sep 17 00:00:00 2001 From: Corey Hickson Date: Wed, 6 Nov 2024 03:32:53 -0800 Subject: [PATCH 3/4] Fixed fmvp.d.x bug --- src/fpu/fctrl.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fpu/fctrl.sv b/src/fpu/fctrl.sv index ab9cad093..d04fc45fa 100755 --- a/src/fpu/fctrl.sv +++ b/src/fpu/fctrl.sv @@ -248,9 +248,9 @@ module fctrl import cvw::*; #(parameter cvw_t P) ( // coverage off // Not covered in testing because rv64gc is not RV64Q or RV32D 7'b1011001: if (P.ZFA_SUPPORTED & P.XLEN == 32 & P.D_SUPPORTED & Funct3D == 3'b000) - ControlsD = `FCTRLW'b1_0_01_00_101_0_0_0_0_0; // fmvp.d.x (Zfa) + ControlsD = `FCTRLW'b1_0_00_00_011_0_0_0_1_0; // fmvp.d.x (Zfa) 7'b1011011: if (P.ZFA_SUPPORTED & P.XLEN == 64 & P.Q_SUPPORTED & Funct3D == 3'b000) - ControlsD = `FCTRLW'b1_0_01_00_101_0_0_0_0_0; // fmvp.q.x (Zfa) + ControlsD = `FCTRLW'b1_0_00_00_011_0_0_0_1_0; // fmvp.q.x (Zfa) // coverage on endcase endcase From ff8ea2adfdbb9c5c7f3375a5763a6e97af864870 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 7 Nov 2024 07:58:54 -0800 Subject: [PATCH 4/4] 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