diff --git a/configs/common/ObjectList.py b/configs/common/ObjectList.py index c91ea0c653..82e4df8fe1 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 f37b1306ac..d02535f524 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")