From: tv-reddy Date: Wed, 26 Feb 2020 23:16:58 +0000 (-0800) Subject: cpu: update info related direction into BP if mispredicted. X-Git-Tag: v20.0.0.0~441 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad65be829e7c6ffeaa143d292a7c4a5ba27c5c7c;p=gem5.git 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 --- 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 "