diff options
-rw-r--r-- | configs/common/Options.py | 8 | ||||
-rw-r--r-- | configs/common/Simulation.py | 1 | ||||
-rw-r--r-- | configs/example/arm/fs_bigLITTLE.py | 9 |
3 files changed, 18 insertions, 0 deletions
diff --git a/configs/common/Options.py b/configs/common/Options.py index aed888191..c36dc384e 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -125,6 +125,14 @@ def addNoISAOptions(parser): parser.add_option("--maxtime", type="float", default=None, help="Run to the specified absolute simulated time in " "seconds") + parser.add_option("-P", "--param", action="append", default=[], + help="Set a SimObject parameter relative to the root node. " + "An extended Python multi range slicing syntax can be used " + "for arrays. For example: " + "'system.cpu[0,1,3:8:2].max_insts_all_threads = 42' " + "sets max_insts_all_threads for cpus 0, 1, 3, 5 and 7 " + "Direct parameters of the root object are not accessible, " + "only parameters of its children.") # Add common options that assume a non-NULL ISA. def addCommonOptions(parser): diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index f306a0358..23a778397 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -597,6 +597,7 @@ def run(options, root, testsys, cpu_class): checkpoint_dir = None if options.checkpoint_restore: cpt_starttick, checkpoint_dir = findCptDir(options, cptdir, testsys) + root.apply_config(options.param) m5.instantiate(checkpoint_dir) # Initialization is complete. If we're not in control of simulation diff --git a/configs/example/arm/fs_bigLITTLE.py b/configs/example/arm/fs_bigLITTLE.py index 7d66c03a6..8cf89e3c7 100644 --- a/configs/example/arm/fs_bigLITTLE.py +++ b/configs/example/arm/fs_bigLITTLE.py @@ -182,6 +182,14 @@ def addOptions(parser): parser.add_argument("--sim-quantum", type=str, default="1ms", help="Simulation quantum for parallel simulation. " \ "Default: %(default)s") + parser.add_argument("-P", "--param", action="append", default=[], + help="Set a SimObject parameter relative to the root node. " + "An extended Python multi range slicing syntax can be used " + "for arrays. For example: " + "'system.cpu[0,1,3:8:2].max_insts_all_threads = 42' " + "sets max_insts_all_threads for cpus 0, 1, 3, 5 and 7 " + "Direct parameters of the root object are not accessible, " + "only parameters of its children.") return parser def build(options): @@ -330,6 +338,7 @@ def main(): addOptions(parser) options = parser.parse_args() root = build(options) + root.apply_config(options.param) instantiate(options) run() |