diff options
author | Joel Hestness <jthestness@gmail.com> | 2013-07-18 14:46:54 -0500 |
---|---|---|
committer | Joel Hestness <jthestness@gmail.com> | 2013-07-18 14:46:54 -0500 |
commit | 7aa67f42cb02be0e47d1395fa5377af4730471dc (patch) | |
tree | 97510e849a33fd9e64e7531aaeb5c6adb6bdc5a2 /configs/common/Options.py | |
parent | c20105c2ff2b8300fa18a5c3f1afb806d6ae9458 (diff) | |
download | gem5-7aa67f42cb02be0e47d1395fa5377af4730471dc.tar.xz |
Configs: Fix up maxtick and maxtime
This patch contains three fixes to max tick options handling in Options.py and
Simulation.py:
1) Since the global simulator frequency isn't bound until m5.instantiate()
is called, the maxtick resolution needs to happen after this call, since
changes to the global frequency will cause m5.simulate() to misinterpret the
maxtick value. Shuffling this also requires tweaking the checkpoint directory
handling to signal the checkpoint restore tick back to run(). Fixing this
completely and correctly will require storing the simulation frequency into
checkpoints, which is beyond the scope of this patch.
2) The maxtick option in Options.py was defaulted to MaxTicks, so the old code
would always skip over the maxtime part of the conditionals at the beginning
of run(). Change the maxtick default to None, and set the maxtick local
variable in run() appropriately.
3) To clarify whether max ticks settings are relative or absolute, split the
maxtick option into separate options, for relative and absolute. Ensure that
these two options and the maxtime option are handled appropriately to set the
maxtick variable in Simulation.py.
Diffstat (limited to 'configs/common/Options.py')
-rw-r--r-- | configs/common/Options.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/configs/common/Options.py b/configs/common/Options.py index ce270fcd4..2fe77aef3 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -109,9 +109,16 @@ def addCommonOptions(parser): parser.add_option("--ruby", action="store_true") # Run duration options - parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick, - metavar="T", help="Stop after T ticks") - parser.add_option("--maxtime", type="float") + parser.add_option("-m", "--abs-max-tick", type="int", default=None, + metavar="TICKS", help="Run to absolute simulated tick " \ + "specified including ticks from a restored checkpoint") + parser.add_option("--rel-max-tick", type="int", default=None, + metavar="TICKS", help="Simulate for specified number of" \ + " ticks relative to the simulation start tick (e.g. if " \ + "restoring a checkpoint)") + parser.add_option("--maxtime", type="float", default=None, + help="Run to the specified absolute simulated time in " \ + "seconds") parser.add_option("-I", "--maxinsts", action="store", type="int", default=None, help="""Total number of instructions to simulate (default: run forever)""") |