configs: Added list types of replacement policy.

Replacement policy is one of the key points in CPU performance. For ease
of checking the avliable replacment types for any cpu architects,
"replacment policy list" is added in Options.py and ObjectList.py.
Just like Branch Prediction Policies, adding such list would make it efficient for compare cpu performance
regarding different replacment policies especially for Cache.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-853

Change-Id: I97358617038fdcec79fa7e59baba8926284727b4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39195
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Jiasen
2021-01-15 11:57:17 +08:00
committed by JIASEN_HUANG
parent 6b355f69a3
commit 6b90ee8142
2 changed files with 10 additions and 1 deletions

View File

@@ -162,7 +162,7 @@ class EnumList(ObjectList):
if not key.startswith("Num_"):
self._sub_classes[key] = value
rp_list = ObjectList(getattr(m5.objects, 'BaseReplacementPolicy', None))
bp_list = ObjectList(getattr(m5.objects, 'BranchPredictor', None))
cpu_list = CPUList(getattr(m5.objects, 'BaseCPU', None))
hwp_list = ObjectList(getattr(m5.objects, 'BasePrefetcher', None))

View File

@@ -68,6 +68,10 @@ def _listHWPTypes(option, opt, value, parser):
ObjectList.hwp_list.print()
sys.exit(0)
def _listRPTypes(option, opt, value, parser):
ObjectList.rp_list.print()
sys.exit(0)
def _listIndirectBPTypes(option, opt, value, parser):
ObjectList.indirect_bp_list.print()
sys.exit(0)
@@ -186,6 +190,11 @@ def addCommonOptions(parser):
parser.add_option("--indirect-bp-type", type="choice", default=None,
choices=ObjectList.indirect_bp_list.get_names(),
help = "type of indirect branch predictor to run with")
parser.add_option("--list-rp-types",
action="callback", callback=_listRPTypes,
help="List available replacement policy types")
parser.add_option("--list-hwp-types",
action="callback", callback=_listHWPTypes,
help="List available hardware prefetcher types")