cpu: simple: Add support for using branch predictors

This changesets adds branch predictor support to the
BaseSimpleCPU. The simple CPUs normally don't need a branch predictor,
however, there are at least two cases where it can be desirable:

  1) A simple CPU can be used to warm the branch predictor of an O3
     CPU before switching to the slower O3 model.

  2) The simple CPU can be used as a quick way of evaluating/debugging
     new branch predictors since it exposes branch predictor
     statistics.

Limitations:
  * Since the simple CPU doesn't speculate, only one instruction will
    be active in the branch predictor at a time (i.e., the branch
    predictor will never see speculative branches).

  * The outcome of a branch prediction does not affect the performance
    of the simple CPU.
This commit is contained in:
Andreas Sandberg
2014-02-09 20:49:28 +01:00
parent eb73a14fe2
commit c52190a695
3 changed files with 73 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ from m5.defines import buildEnv
from m5.params import *
from BaseCPU import BaseCPU
from DummyChecker import DummyChecker
from BranchPredictor import BranchPredictor
class BaseSimpleCPU(BaseCPU):
type = 'BaseSimpleCPU'
@@ -46,3 +47,5 @@ class BaseSimpleCPU(BaseCPU):
else:
print "ERROR: Checker only supported under ARM ISA!"
exit(1)
branchPred = Param.BranchPredictor(NULL, "Branch Predictor")