From 857004c3a35da16d59885a40582c54b0d22426fd Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Fri, 27 Jan 2023 15:28:31 -0600 Subject: [PATCH] Removed pessimistic x propagation issue for wally32priv test in the branch predictor. --- pipelined/src/ifu/brpred/speculativegshare.sv | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pipelined/src/ifu/brpred/speculativegshare.sv b/pipelined/src/ifu/brpred/speculativegshare.sv index 00a49ce2..f1810f62 100644 --- a/pipelined/src/ifu/brpred/speculativegshare.sv +++ b/pipelined/src/ifu/brpred/speculativegshare.sv @@ -106,9 +106,21 @@ module speculativegshare satCounter2 BPDirUpdateE(.BrDir(PCSrcE), .OldState(DirPredictionE), .NewState(NewDirPredictionE)); // GHR pipeline + // this version fails the regression test do to pessimistic x propagation. +/* -----\/----- EXCLUDED -----\/----- assign GHRNextF = FlushD ? (BranchInstrE ? GHRNextD[k:1] : GHRNextD[k-1:0]) : BranchInstrF ? {DirPredictionF[1], GHRF[k-1:1]} : GHRF; + -----/\----- EXCLUDED -----/\----- */ + + always_comb begin + if(FlushD) begin + if(BranchInstrE) GHRNextF = GHRNextD[k:1]; + else GHRNextF = GHRNextD[k-1:0]; + end else if(BranchInstrF) GHRNextF = {DirPredictionF[1], GHRF[k-1:1]}; + else GHRNextF = GHRF; + end + flopenr #(k) GHRFReg(clk, reset, (~StallF) | FlushD, GHRNextF, OldGHRF); flopenr #(1) GHRFExtraReg(clk, reset, (~StallF) | FlushD, GHRNextF[0], OldGHRExtraF);