summaryrefslogtreecommitdiff
path: root/configs/common/Options.py
diff options
context:
space:
mode:
authorPau Cabre <pau.cabre@metempsy.com>2018-11-07 23:22:05 +0100
committerPau Cabre <pau.cabre@metempsy.com>2018-11-17 16:57:58 +0000
commit439b68a21e5122df2e6d1b9aad7ac46af619cc75 (patch)
tree75e58c5261518891b4435912545ce3bdd33b9ddb /configs/common/Options.py
parentcb9fa244036772fc1d2c73fa2f4b10e98cd6e17a (diff)
downloadgem5-439b68a21e5122df2e6d1b9aad7ac46af619cc75.tar.xz
configs: Added an option for choosing branch predictor type
Added the parameter "--bp-type" to set the branch predictor type Added the parameter "--list-bp-types" to list all the available branch predictor types Change-Id: Ia6aae90c784aef359b6d8233c8383cd7a871aca1 Signed-off-by: Pau Cabre <pau.cabre@metempsy.com> Reviewed-on: https://gem5-review.googlesource.com/c/14015 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'configs/common/Options.py')
-rw-r--r--configs/common/Options.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/configs/common/Options.py b/configs/common/Options.py
index c36dc384e..536da44f0 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -44,6 +44,7 @@ from m5.objects import *
from common.Benchmarks import *
from common import CpuConfig
+from common import BPConfig
from common import MemConfig
from common import PlatformConfig
@@ -51,6 +52,10 @@ def _listCpuTypes(option, opt, value, parser):
CpuConfig.print_cpu_list()
sys.exit(0)
+def _listBPTypes(option, opt, value, parser):
+ BPConfig.print_bp_list()
+ sys.exit(0)
+
def _listMemTypes(option, opt, value, parser):
MemConfig.print_mem_list()
sys.exit(0)
@@ -146,6 +151,15 @@ def addCommonOptions(parser):
parser.add_option("--cpu-type", type="choice", default="AtomicSimpleCPU",
choices=CpuConfig.cpu_names(),
help = "type of cpu to run with")
+ parser.add_option("--list-bp-types",
+ action="callback", callback=_listBPTypes,
+ help="List available branch predictor types")
+ parser.add_option("--bp-type", type="choice", default=None,
+ choices=BPConfig.bp_names(),
+ help = """
+ type of branch predictor to run with
+ (if not set, use the default branch predictor of
+ the selected CPU)""")
parser.add_option("--checker", action="store_true");
parser.add_option("--cpu-clock", action="store", type="string",
default='2GHz',