Set cpu_id params (required by ll/sc code now).
[gem5.git] / configs / example / fs.py
index 71c5961efd06c5471a73b88d6af541ded093319e..6db26a02a47d6aaa06199664484002a1c0f13089 100644 (file)
@@ -49,10 +49,12 @@ parser.add_option("--dual", action="store_true",
 parser.add_option("-b", "--benchmark", action="store", type="string",
                   dest="benchmark",
                   help="Specify the benchmark to run. Available benchmarks: %s"\
-                          % DefinedBenchmarks)
+                  % DefinedBenchmarks)
 parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
-                  help="Specify the filename to dump a pcap capture of the ethernet"
-                  "traffic")
+                  help="Specify the filename to dump a pcap capture of the" \
+                  "ethernet traffic")
+parser.add_option("--checkpoint_dir", action="store", type="string",
+                  help="Place all checkpoints in this absolute directory")
 
 (options, args) = parser.parse_args()
 
@@ -75,6 +77,8 @@ else:
 
 cpu.clock = '2GHz'
 cpu2.clock = '2GHz'
+cpu.cpu_id = 0
+cpu2.cpu_id = 0
 
 if options.benchmark:
     if options.benchmark not in Benchmarks:
@@ -123,7 +127,14 @@ else:
 exit_event = m5.simulate(maxtick)
 
 while exit_event.getCause() == "checkpoint":
-    m5.checkpoint(root, "cpt.%d")
-    exit_event = m5.simulate(maxtick - m5.curTick())
+    if options.checkpoint_dir:
+        m5.checkpoint(root, "/".join([options.checkpoint_dir, "cpt.%d"]))
+    else:
+        m5.checkpoint(root, "cpt.%d")
+
+    if maxtick == -1:
+        exit_event = m5.simulate(maxtick)
+    else:
+        exit_event = m5.simulate(maxtick - m5.curTick())
 
 print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause()