2006-07-11 05:00:13 +02:00
|
|
|
import optparse, os, sys
|
|
|
|
|
2006-06-10 06:22:42 +02:00
|
|
|
import m5
|
|
|
|
from m5.objects import *
|
2006-07-21 21:56:35 +02:00
|
|
|
m5.AddToPath('../common')
|
|
|
|
from FSConfig import *
|
2006-04-12 23:46:25 +02:00
|
|
|
from SysPaths import *
|
2006-07-21 21:56:35 +02:00
|
|
|
from Util import *
|
2006-04-12 23:46:25 +02:00
|
|
|
|
2006-07-11 05:00:13 +02:00
|
|
|
parser = optparse.OptionParser()
|
2006-06-10 06:22:42 +02:00
|
|
|
|
2006-07-12 23:17:17 +02:00
|
|
|
parser.add_option("-d", "--detailed", action="store_true")
|
2006-06-10 06:22:42 +02:00
|
|
|
parser.add_option("-t", "--timing", action="store_true")
|
2006-07-12 23:17:17 +02:00
|
|
|
parser.add_option("-m", "--maxtick", type="int")
|
2006-07-21 01:00:40 +02:00
|
|
|
parser.add_option("--maxtime", type="float")
|
2006-07-12 23:17:17 +02:00
|
|
|
parser.add_option("--dual", help="Run full system using dual systems",
|
|
|
|
action="store_true")
|
2006-06-10 06:22:42 +02:00
|
|
|
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
|
|
|
|
if args:
|
|
|
|
print "Error: script doesn't take any positional arguments"
|
|
|
|
sys.exit(1)
|
|
|
|
|
2006-07-21 21:56:35 +02:00
|
|
|
if options.detailed:
|
|
|
|
cpu = DetailedO3CPU()
|
|
|
|
cpu2 = DetailedO3CPU()
|
|
|
|
mem_mode = 'Timing'
|
|
|
|
elif options.timing:
|
|
|
|
cpu = TimingSimpleCPU()
|
|
|
|
cpu2 = TimingSimpleCPU()
|
|
|
|
mem_mode = 'Timing'
|
|
|
|
else:
|
|
|
|
cpu = AtomicSimpleCPU()
|
|
|
|
cpu2 = AtomicSimpleCPU()
|
|
|
|
mem_mode = 'Atomic'
|
2006-04-25 01:31:50 +02:00
|
|
|
|
2006-07-12 23:17:17 +02:00
|
|
|
if options.dual:
|
|
|
|
root = DualRoot(
|
2006-07-21 21:56:35 +02:00
|
|
|
MyLinuxAlphaSystem(cpu, mem_mode, linux_image),
|
|
|
|
MyLinuxAlphaSystem(cpu2, mem_mode, linux_image))
|
|
|
|
root.client.readfile = script('netperf-stream-nt-client.rcS')
|
|
|
|
root.server.readfile = script('netperf-server.rcS')
|
2006-07-12 23:17:17 +02:00
|
|
|
else:
|
2006-07-21 22:08:17 +02:00
|
|
|
root = TsunamiRoot(clock = '1THz', system = MyLinuxAlphaSystem(cpu, mem_mode, linux_image))
|
2006-04-25 01:31:50 +02:00
|
|
|
|
2006-06-10 06:22:42 +02:00
|
|
|
m5.instantiate(root)
|
|
|
|
|
2006-07-13 21:48:17 +02:00
|
|
|
#exit_event = m5.simulate(2600000000000)
|
|
|
|
#if exit_event.getCause() != "user interrupt received":
|
|
|
|
# m5.checkpoint(root, 'cpt')
|
|
|
|
# exit_event = m5.simulate(300000000000)
|
|
|
|
# if exit_event.getCause() != "user interrupt received":
|
|
|
|
# m5.checkpoint(root, 'cptA')
|
|
|
|
|
|
|
|
|
2006-07-12 23:17:17 +02:00
|
|
|
if options.maxtick:
|
|
|
|
exit_event = m5.simulate(options.maxtick)
|
2006-07-21 01:00:40 +02:00
|
|
|
elif options.maxtime:
|
|
|
|
simtime = int(options.maxtime * root.clock.value)
|
|
|
|
print "simulating for: ", simtime
|
|
|
|
exit_event = m5.simulate(simtime)
|
2006-07-12 23:17:17 +02:00
|
|
|
else:
|
|
|
|
exit_event = m5.simulate()
|
2006-06-10 06:22:42 +02:00
|
|
|
|
2006-06-15 17:45:51 +02:00
|
|
|
print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause()
|