Config: Add support for restoring using a timing CPU
authorNilay Vaish <nilay@cs.wisc.edu>
Wed, 11 Jan 2012 19:50:18 +0000 (13:50 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Wed, 11 Jan 2012 19:50:18 +0000 (13:50 -0600)
Currently there is an assumption that restoration from a checkpoint will
happen by first restoring to an atomic CPU and then switching to a timing
CPU. This patch adds support for directly restoring to a timing CPU. It
adds a new option '--restore-with-cpu' which is used to specify the type
of CPU to which the checkpoint should be restored to. It defaults to
'atomic' which was the case before.

configs/common/Options.py
configs/common/Simulation.py

index ff4acbe37100fed960224462171215afff1396a6..1941875bc2a0a9d22e19142c6f01fd7116db417b 100644 (file)
@@ -85,6 +85,10 @@ parser.add_option("--work-end-checkpoint-count", action="store", type="int",
                   help="checkpoint at specified work end count")
 parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
                   help="checkpoint and exit when active cpu count is reached")
+parser.add_option("--restore-with-cpu", action="store", type="choice",
+                  default="atomic", choices = ["atomic", "timing",
+                                               "detailed", "inorder"],
+                  help = "cpu type for restoring from a checkpoint")
 
 
 # CPU Switching - default switch model goes from a checkpoint
index 1897fa8cbc3185eac77807e2ffc9fdc29437e8e3..434fe8369c274c87a27f7cb0c84d795aed6c8684 100644 (file)
@@ -60,7 +60,15 @@ def setCPUClass(options):
     test_mem_mode = 'atomic'
 
     if not atomic:
-        if options.checkpoint_restore != None or options.fast_forward:
+        if options.checkpoint_restore != None:
+            if options.restore_with_cpu != options.cpu_type:
+                CPUClass = TmpClass
+                class TmpClass(AtomicSimpleCPU): pass
+            else:
+                if options.restore_with_cpu != "atomic":
+                    test_mem_mode = 'timing'
+
+        elif options.fast_forward:
             CPUClass = TmpClass
             class TmpClass(AtomicSimpleCPU): pass
         else: