summaryrefslogtreecommitdiff
path: root/src/python/m5
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:17:06 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:17:06 -0700
commit2519d116c9171ed4bf220d5049f244b333aa0842 (patch)
tree9aa0a55cf7274e0657383903043e65b3d8fc8eaa /src/python/m5
parentcfaddd5fd348bfa6fb8e575d87ca75a05e04b3b0 (diff)
downloadgem5-2519d116c9171ed4bf220d5049f244b333aa0842.tar.xz
sim: fold checkpoint restore code into instantiate()
The separate restoreCheckpoint() call is gone; just pass the checkpoint dir as an optional arg to instantiate(). This change is a precursor to some more extensive reworking of the startup code.
Diffstat (limited to 'src/python/m5')
-rw-r--r--src/python/m5/simulate.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 28ba10c0d..0cf0a254e 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -46,7 +46,7 @@ MaxTick = 2**63 - 1
# The final hook to generate .ini files. Called from the user script
# once the config is built.
-def instantiate():
+def instantiate(ckpt_dir=None):
root = objects.Root.getInstance()
if not root:
@@ -86,6 +86,11 @@ def instantiate():
# We're done registering statistics. Enable the stats package now.
stats.enable()
+ # Restore checkpoint (if any)
+ if ckpt_dir:
+ internal.core.unserializeAll(ckpt_dir)
+ need_resume.append(root)
+
# Reset to put the stats in a consistent state.
stats.reset()
@@ -160,13 +165,6 @@ def checkpoint(dir):
internal.core.serializeAll(dir)
resume(root)
-def restoreCheckpoint(dir):
- root = objects.Root.getInstance()
- print "Restoring from checkpoint"
- internal.core.unserializeAll(dir)
- need_resume.append(root)
- stats.reset()
-
def changeToAtomic(system):
if not isinstance(system, (objects.Root, objects.System)):
raise TypeError, "Parameter of type '%s'. Must be type %s or %s." % \