From 6b90ee8142ee044ed6118679a3bbc388d12e03cd Mon Sep 17 00:00:00 2001 From: Jiasen Date: Fri, 15 Jan 2021 11:57:17 +0800 Subject: [PATCH] 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 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- configs/common/ObjectList.py | 2 +- configs/common/Options.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configs/common/ObjectList.py b/configs/common/ObjectList.py index c91ea0c65..82e4df8fe 100644 --- a/configs/common/ObjectList.py +++ b/configs/common/ObjectList.py @@ -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)) diff --git a/configs/common/Options.py b/configs/common/Options.py index f37b1306a..d02535f52 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -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") -- 2.30.2