fixed minor bugs in localHistory

This commit is contained in:
Shreya Sanghai 2021-04-01 13:40:08 -04:00
parent 28a9c6ba56
commit df149d1be7
5 changed files with 18 additions and 5 deletions

View File

@ -94,5 +94,5 @@
`define TWO_BIT_PRELOAD "../config/rv32ic/twoBitPredictor.txt"
`define BTB_PRELOAD "../config/rv32ic/BTBPredictor.txt"
`define BPTYPE "BPGSHARE" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define BPTYPE "BPLOCALPAg" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define TESTSBP 0

View File

@ -97,5 +97,5 @@
`define TWO_BIT_PRELOAD "../config/rv64ic/twoBitPredictor.txt"
`define BTB_PRELOAD "../config/rv64ic/BTBPredictor.txt"
`define BPTYPE "BPGSHARE" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define BPTYPE "BPLOCALPAg" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define TESTSBP 0

View File

@ -97,5 +97,5 @@
`define TWO_BIT_PRELOAD "../config/rv64icfd/twoBitPredictor.txt"
`define BTB_PRELOAD "../config/rv64icfd/BTBPredictor.txt"
`define BPTYPE "BPGSHARE" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define BPTYPE "BPGLOBAL" // BPGLOBAL or BPTWOBIT or BPGSHARE
`define TESTSBP 0

View File

@ -104,6 +104,19 @@ module bpred
.PCSrcE(PCSrcE),
.UpdatePrediction(UpdateBPPredE));
end
else if (`BPTYPE == "BPLOCALPAg") begin:Predictor
localHistoryPredictor DirPredictor(.clk(clk),
.reset(reset),
.*, // Stalls and flushes
.LookUpPC(PCNextF),
.Prediction(BPPredF),
// update
.UpdatePC(PCE),
.UpdateEN(InstrClassE[0] & ~StallE),
.PCSrcE(PCSrcE),
.UpdatePrediction(UpdateBPPredE));
end
endgenerate

View File

@ -44,7 +44,7 @@ module localHistoryPredictor
);
logic [2**m-1:0][k-1:0] LHRNextF;
logic [k-1:0] LHRD, LHRE, LHRENext, ForwardLHRNext;
logic [k-1:0] LHRF, LHRD, LHRE, LHRENext, ForwardLHRNext;
logic [m-1:0] LookUpPCIndex, UpdatePCIndex;
logic [1:0] PredictionMemory;
logic DoForwarding, DoForwardingF, DoForwardingPHT, DoForwardingPHTF;
@ -67,7 +67,7 @@ module localHistoryPredictor
genvar index;
generate
for (index = 0; index < 2**m; index = index +1) begin:index
for (index = 0; index < 2**m; index = index +1) begin
flopenr #(k) LocalHistoryRegister(.clk(clk),
.reset(reset),