from SysPaths import *
from Benchmarks import *
+if not m5.build_env['FULL_SYSTEM']:
+ m5.panic("This script requires full-system mode (ALPHA_FS).")
+
parser = optparse.OptionParser()
parser.add_option("-d", "--detailed", 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()
cpu.clock = '2GHz'
cpu2.clock = '2GHz'
+cpu.cpu_id = 0
+cpu2.cpu_id = 0
if options.benchmark:
if options.benchmark not in Benchmarks:
s1 = makeLinuxAlphaSystem(mem_mode, bm[0])
s1.cpu = cpu
cpu.connectMemPorts(s1.membus)
+ cpu.mem = s1.physmem
s2 = makeLinuxAlphaSystem(mem_mode, bm[1])
s2.cpu = cpu2
cpu2.connectMemPorts(s2.membus)
+ cpu2.mem = s2.physmem
root = makeDualRoot(s1, s2, options.etherdump)
elif len(bm) == 1:
root = Root(clock = '1THz',
system = makeLinuxAlphaSystem(mem_mode, bm[0]))
root.system.cpu = cpu
cpu.connectMemPorts(root.system.membus)
+ cpu.mem = root.system.physmem
else:
print "Error I don't know how to create more than 2 systems."
sys.exit(1)
m5.instantiate(root)
if options.maxtick:
- arg = options.maxtick
+ maxtick = options.maxtick
elif options.maxtime:
simtime = int(options.maxtime * root.clock.value)
print "simulating for: ", simtime
- arg = simtime
+ maxtick = simtime
else:
- arg = -1
+ maxtick = -1
-exit_event = m5.simulate(arg)
+exit_event = m5.simulate(maxtick)
while exit_event.getCause() == "checkpoint":
+ if options.checkpoint_dir:
+ m5.checkpoint(root, "/".join([options.checkpoint_dir, "cpt.%d"]))
+ else:
m5.checkpoint(root, "cpt.%d")
- exit_event = m5.simulate(arg)
+
+ 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()