Compacted memory resets.

This commit is contained in:
Ross Thompson 2023-06-13 13:57:58 -05:00
parent 269d7b2430
commit 7d53af9206

View File

@ -325,34 +325,20 @@ module testbench;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
integer adrindex; integer adrindex;
if (P.UNCORE_RAM_SUPPORTED) always @(posedge clk) begin
always @(posedge clk) if (ResetMem) begin
if (ResetMem) if (P.UNCORE_RAM_SUPPORTED)
for (adrindex=0; adrindex<(P.UNCORE_RAM_RANGE>>1+(P.XLEN/32)); adrindex = adrindex+1) for (adrindex=0; adrindex<(P.UNCORE_RAM_RANGE>>1+(P.XLEN/32)); adrindex = adrindex+1)
dut.uncore.uncore.ram.ram.memory.RAM[adrindex] = '0; dut.uncore.uncore.ram.ram.memory.RAM[adrindex] = '0;
if (P.BPRED_SUPPORTED) begin
// *** add resets for each memory // local history only
if (P.BPRED_TYPE == BP_LOCAL_AHEAD | P.BPRED_TYPE == BP_LOCAL_REPAIR)
if (P.BPRED_SUPPORTED) begin for(adrindex = 0; adrindex < 2**P.BPRED_NUM_LHR; adrindex++)
// 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
dut.core.ifu.bpred.bpred.Predictor.DirPredictor.BHT.mem[adrindex] = 0; dut.core.ifu.bpred.bpred.Predictor.DirPredictor.BHT.mem[adrindex] = 0;
end for(adrindex = 0; adrindex < 2**P.BTB_SIZE; adrindex++)
end
end
end
always @(posedge clk) begin
if(ResetMem) begin
for(adrindex = 0; adrindex < 2**P.BTB_SIZE; adrindex++) begin
dut.core.ifu.bpred.bpred.TargetPredictor.memory.mem[adrindex] = 0; dut.core.ifu.bpred.bpred.TargetPredictor.memory.mem[adrindex] = 0;
end for(adrindex = 0; adrindex < 2**P.BPRED_SIZE; adrindex++)
for(adrindex = 0; adrindex < 2**P.BPRED_SIZE; adrindex++) begin
dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PHT.mem[adrindex] = 0; dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PHT.mem[adrindex] = 0;
end
end end
end end
end end