From 08b237b8784133ec9a4702bab7d90405c460f8ee Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Tue, 2 May 2023 11:01:46 -0500 Subject: [PATCH] Added comment explaining the difference between global history and local history basic implementations. --- src/ifu/bpred/localHistoryPredictor.sv | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifu/bpred/localHistoryPredictor.sv b/src/ifu/bpred/localHistoryPredictor.sv index 60471b701..e2f267fff 100644 --- a/src/ifu/bpred/localHistoryPredictor.sv +++ b/src/ifu/bpred/localHistoryPredictor.sv @@ -74,6 +74,12 @@ module localHistoryPredictor #(parameter m = 6, // 2^m = number of local history assign BPDirPredWrongE = PCSrcE != BPDirPredE[1] & BranchE; + // this is the main difference between global and local history basic implementations rather than + // having multiple history registers. In global, the ghr wraps back into itself directly without + // being pipelined. IE. GHR is not read in F and then pipelined to M where it is updated. Instead + // GHR is just read in M and updated. GHR is still pipelined so that the PHT is updated with the correct + // GHR. Local history in contrast must pipeline the specific history register read during F and then update + // that same one in M. This implementation does not forward if a branch matches in the D, E, or M stages. assign LHRNextW = BranchM ? {PCSrcM, LHRM[k-1:1]} : LHRM; // this is local history