gem5/src/cpu/pred
Arthur Perais 497cc2d373 cpu: disallow speculative update of branch predictor tables (o3)
The Minor and o3 cpu models share the branch prediction
code. Minor relies on the BPredUnit::squash() function
to update the branch predictor tables on a branch mispre-
diction. This is fine because Minor executes in-order, so
the update is on the correct path. However, this causes the
branch predictor to be updated on out-of-order branch
mispredictions when using the o3 model, which should not
be the case.

This patch guards against speculative update of the branch
prediction tables. On a branch misprediction, BPredUnit::squash()
calls BpredUnit::update(..., squashed = true). The underlying
branch predictor tests against the value of squashed. If it is
true, it restores any speculatively updated internal state
it might have (e.g., global/local branch history), then returns.
If false, it updates its prediction tables. Previously, exist-
ing predictors did not test against the "squashed" parameter.

To accomodate for this change, the Minor model must now call
BPredUnit::squash() then BPredUnit::update(..., squashed = false)
on branch mispredictions. Before, calling BpredUnit::squash()
performed the prediction tables update.

The effect is a slight MPKI improvement when using the o3
model. A further patch should perform the same modifications
for the indirect target predictor and BTB (less critical).

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2016-12-21 15:07:16 -06:00
..
2bit_local.cc cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
2bit_local.hh cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
bi_mode.cc cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
bi_mode.hh cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
bpred_unit.cc cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
bpred_unit.hh cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
BranchPredictor.py cpu: Add an indirect branch target predictor 2016-04-05 11:48:37 -05:00
btb.cc Revert power patch sets with unexpected interactions 2016-04-06 19:43:31 +01:00
btb.hh Revert power patch sets with unexpected interactions 2016-04-06 19:43:31 +01:00
indirect.cc cpu: Add an indirect branch target predictor 2016-04-05 11:48:37 -05:00
indirect.hh cpu: Add an indirect branch target predictor 2016-04-05 11:48:37 -05:00
ras.cc ISA,CPU,etc: Create an ISA defined PC type that abstracts out ISA behaviors. 2010-10-31 00:07:20 -07:00
ras.hh branch predictor: move out of o3 and inorder cpus 2013-01-24 12:28:51 -06:00
sat_counter.hh scons: Enable -Wextra by default 2016-01-11 05:52:20 -05:00
SConscript cpu: Add an indirect branch target predictor 2016-04-05 11:48:37 -05:00
tournament.cc cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00
tournament.hh cpu: disallow speculative update of branch predictor tables (o3) 2016-12-21 15:07:16 -06:00