From 05189d102ac5de8fa778ecd2836b1c00c8035e7c Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 26 Nov 2024 22:09:11 -0800 Subject: [PATCH] Modifying tracer toward being able to run non-gc configurations in lockstep --- testbench/common/wallyTracer.sv | 355 +++++++++++++++++--------------- testbench/testbench.sv | 14 +- 2 files changed, 195 insertions(+), 174 deletions(-) diff --git a/testbench/common/wallyTracer.sv b/testbench/common/wallyTracer.sv index a32417737..51f0d302a 100644 --- a/testbench/common/wallyTracer.sv +++ b/testbench/common/wallyTracer.sv @@ -95,11 +95,19 @@ module wallyTracer import cvw::*; #(parameter cvw_t P) (rvviTrace rvvi); assign FlushW = testbench.dut.core.FlushW; assign TrapM = testbench.dut.core.TrapM; assign HaltM = testbench.DCacheFlushStart; - assign PrivilegeModeW = testbench.dut.core.priv.priv.privmode.PrivilegeModeW; - assign STATUS_SXL = testbench.dut.core.priv.priv.csr.csrsr.STATUS_SXL; - assign STATUS_UXL = testbench.dut.core.priv.priv.csr.csrsr.STATUS_UXL; - assign wfiM = testbench.dut.core.priv.priv.wfiM; - assign InterruptM = testbench.dut.core.priv.priv.InterruptM; + if (P.ZICSR_SUPPORTED) begin + assign PrivilegeModeW = testbench.dut.core.priv.priv.privmode.PrivilegeModeW; + assign STATUS_SXL = testbench.dut.core.priv.priv.csr.csrsr.STATUS_SXL; + assign STATUS_UXL = testbench.dut.core.priv.priv.csr.csrsr.STATUS_UXL; + assign wfiM = testbench.dut.core.priv.priv.wfiM; + assign InterruptM = testbench.dut.core.priv.priv.InterruptM; + end else begin + assign PrivilegeModeW = 2'b11; + assign STATUS_SXL = 0; + assign STATUS_UXL = 0; + assign wfiM = 0; + assign InterruptM = 0; + end //For VM Verification assign VAdrIM = testbench.dut.core.ifu.immu.immu.tlb.tlb.VAdr; @@ -116,181 +124,185 @@ module wallyTracer import cvw::*; #(parameter cvw_t P) (rvviTrace rvvi); logic valid; - always_comb begin - // Since we are detected the CSR change by comparing the old value we need to - // ensure the CSR is detected when the pipeline's Writeback stage is not - // stalled. If it is stalled we want CSRArray to hold the old value. - if(valid) begin - // PMPCFG CSRs (space is 0-15 3a0 - 3af) - localparam inc = P.XLEN == 32 ? 4 : 8; - int i, i4, i8, csrid; - logic [P.XLEN-1:0] pmp; + if (P.ZICSR_SUPPORTED) begin + always_comb begin + // Since we are detected the CSR change by comparing the old value we need to + // ensure the CSR is detected when the pipeline's Writeback stage is not + // stalled. If it is stalled we want CSRArray to hold the old value. + if(valid) begin + // PMPCFG CSRs (space is 0-15 3a0 - 3af) + localparam inc = P.XLEN == 32 ? 4 : 8; + int i, i4, i8, csrid; + logic [P.XLEN-1:0] pmp; - for (i=0; i