changeset 8a4040874157 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=8a4040874157
description:
config: Add ability to exit simulation after initialization
When using gem5 as a slave simulator, it will not advance the
clock on its own and depends on the master simulator calling
simulate(). This new option lets us use the Python scripts
to do all the configuration while stopping short of actually
simulating anything.
diffstat:
configs/common/Options.py | 3 +++
configs/common/Simulation.py | 7 +++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diffs (30 lines):
diff -r f9c0692f73ec -r 8a4040874157 configs/common/Options.py
--- a/configs/common/Options.py Mon Mar 23 06:57:36 2015 -0400
+++ b/configs/common/Options.py Mon Mar 23 06:57:38 2015 -0400
@@ -150,6 +150,9 @@
parser.add_option("--init-param", action="store", type="int", default=0,
help="""Parameter available in simulation with m5
initparam""")
+ parser.add_option("--initialize-only", action="store_true", default=False,
+ help="""Exit after initialization. Do not simulate time.
+ Useful when gem5 is run as a library.""")
# Simpoint options
parser.add_option("--simpoint-profile", action="store_true",
diff -r f9c0692f73ec -r 8a4040874157 configs/common/Simulation.py
--- a/configs/common/Simulation.py Mon Mar 23 06:57:36 2015 -0400
+++ b/configs/common/Simulation.py Mon Mar 23 06:57:38 2015 -0400
@@ -581,6 +581,13 @@
cpt_starttick, checkpoint_dir = findCptDir(options, cptdir, testsys)
m5.instantiate(checkpoint_dir)
+ # Initialization is complete. If we're not in control of simulation
+ # (that is, if we're a slave simulator acting as a component in another
+ # 'master' simulator) then we're done here. The other simulator will
+ # call simulate() directly. --initialize-only is used to indicate this.
+ if options.initialize_only:
+ return
+
# Handle the max tick settings now that tick frequency was resolved
# during system instantiation
# NOTE: the maxtick variable here is in absolute ticks, so it must
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev