From 4bdecf8c6ded69815e8d35cb97ac9137f9075be3 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Tue, 13 Jun 2023 13:57:58 -0500 Subject: [PATCH] Compacted memory resets. --- testbench/testbench.sv | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/testbench/testbench.sv b/testbench/testbench.sv index fad6d35f0..f59d47cc5 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -325,34 +325,20 @@ module testbench; //////////////////////////////////////////////////////////////////////////////// integer adrindex; - if (P.UNCORE_RAM_SUPPORTED) - always @(posedge clk) - if (ResetMem) + always @(posedge clk) begin + if (ResetMem) begin + if (P.UNCORE_RAM_SUPPORTED) for (adrindex=0; adrindex<(P.UNCORE_RAM_RANGE>>1+(P.XLEN/32)); adrindex = adrindex+1) dut.uncore.uncore.ram.ram.memory.RAM[adrindex] = '0; - - // *** add resets for each memory - - if (P.BPRED_SUPPORTED) begin - // local history only - if (P.BPRED_TYPE == BP_LOCAL_AHEAD | P.BPRED_TYPE == BP_LOCAL_REPAIR) begin - always @(posedge clk) begin - if (ResetMem) begin - for(adrindex = 0; adrindex < 2**P.BPRED_NUM_LHR; adrindex++) begin + if (P.BPRED_SUPPORTED) begin + // local history only + if (P.BPRED_TYPE == BP_LOCAL_AHEAD | P.BPRED_TYPE == BP_LOCAL_REPAIR) + for(adrindex = 0; adrindex < 2**P.BPRED_NUM_LHR; adrindex++) dut.core.ifu.bpred.bpred.Predictor.DirPredictor.BHT.mem[adrindex] = 0; - end - end - end - end - - always @(posedge clk) begin - if(ResetMem) begin - for(adrindex = 0; adrindex < 2**P.BTB_SIZE; adrindex++) begin + for(adrindex = 0; adrindex < 2**P.BTB_SIZE; adrindex++) dut.core.ifu.bpred.bpred.TargetPredictor.memory.mem[adrindex] = 0; - end - for(adrindex = 0; adrindex < 2**P.BPRED_SIZE; adrindex++) begin + for(adrindex = 0; adrindex < 2**P.BPRED_SIZE; adrindex++) dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PHT.mem[adrindex] = 0; - end end end end