From ad65be829e7c6ffeaa143d292a7c4a5ba27c5c7c Mon Sep 17 00:00:00 2001 From: tv-reddy Date: Wed, 26 Feb 2020 15:16:58 -0800 Subject: [PATCH] cpu: update info related direction into BP if mispredicted. Update direction info of a branch into BP if, the branch is not found in the target buffer. Therefore, this updated direction is used to squash the branch later on. Previously, some mispredicted branches were not sqaushed as the BP had old info. Reported-by: Dimitrios Chasapis Change-Id: I4be2eb706edc5ffa9935948fb52a01667286c721 jira-issue: https://gem5.atlassian.net/browse/GEM5-355 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25903 Reviewed-by: Bobby R. Bruce Reviewed-by: Ayaz Akram Reviewed-by: Jason Lowe-Power Reviewed-by: Dimitrios Chasapis Reviewed-by: Giacomo Travaglini Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/cpu/pred/bpred_unit.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc index 3d9e3ea5a..4b93e30b3 100644 --- a/src/cpu/pred/bpred_unit.cc +++ b/src/cpu/pred/bpred_unit.cc @@ -263,6 +263,7 @@ BPredUnit::predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, DPRINTF(Branch, "[tid:%i] [sn:%llu] BTB doesn't have a " "valid entry\n",tid,seqNum); pred_taken = false; + predict_record.predTaken = pred_taken; // The Direction of the branch predictor is altered // because the BTB did not have an entry // The predictor needs to be updated accordingly @@ -293,6 +294,7 @@ BPredUnit::predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, } else { ++indirectMisses; pred_taken = false; + predict_record.predTaken = pred_taken; DPRINTF(Branch, "[tid:%i] [sn:%llu] " "Instruction %s no indirect " -- 2.30.2