From 2224679694d499ef9c9d14a523ddf8e7196ae73b Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Thu, 5 Jan 2023 14:18:00 -0600 Subject: [PATCH] Added speculative gshare. --- pipelined/config/rv64gc/wally-config.vh | 2 +- pipelined/src/ifu/bpred.sv | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pipelined/config/rv64gc/wally-config.vh b/pipelined/config/rv64gc/wally-config.vh index c406b995..0be34a9e 100644 --- a/pipelined/config/rv64gc/wally-config.vh +++ b/pipelined/config/rv64gc/wally-config.vh @@ -140,7 +140,7 @@ `define PLIC_UART_ID 10 `define BPRED_ENABLED 1 -`define BPTYPE "BPSPECULATIVEGLOBAL" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE BPSPECULATIVEGLOBAL +`define BPTYPE "BPSPECULATIVEGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE or BPSPECULATIVEGLOBAL or BPSPECULATIVEGSHARE `define TESTSBP 0 `define BPRED_SIZE 10 diff --git a/pipelined/src/ifu/bpred.sv b/pipelined/src/ifu/bpred.sv index 9f46d7a9..a6128c15 100644 --- a/pipelined/src/ifu/bpred.sv +++ b/pipelined/src/ifu/bpred.sv @@ -106,8 +106,14 @@ module bpred ( gshare DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .FlushD, .FlushE, .FlushM, .PCNextF, .PCM, .DirPredictionF, .DirPredictionWrongE, .BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]), .PCSrcE); - end - else if (`BPTYPE == "BPLOCALPAg") begin:Predictor + + end else if (`BPTYPE == "BPSPECULATIVEGSHARE") begin:Predictor + speculativegshare DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW, + .PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE, + .BranchInstrF(BPInstrClassF[0]), .BranchInstrD(BPInstrClassD[0]), .BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]), + .BranchInstrW(InstrClassW[0]), .PCSrcE); + + end else if (`BPTYPE == "BPLOCALPAg") begin:Predictor // *** Fix me /* -----\/----- EXCLUDED -----\/----- localHistoryPredictor DirPredictor(.clk,