fs.py revision 2953
1import optparse, os, sys
2
3import m5
4from m5.objects import *
5m5.AddToPath('../common')
6from FSConfig import *
7from SysPaths import *
8from Util import *
9
10parser = optparse.OptionParser()
11
12parser.add_option("-d", "--detailed", action="store_true")
13parser.add_option("-t", "--timing", action="store_true")
14parser.add_option("-m", "--maxtick", type="int")
15parser.add_option("--maxtime", type="float")
16parser.add_option("--dual", help="Run full system using dual systems",
17                  action="store_true")
18
19(options, args) = parser.parse_args()
20
21if args:
22    print "Error: script doesn't take any positional arguments"
23    sys.exit(1)
24
25if options.detailed:
26    cpu = DetailedO3CPU()
27    cpu2 = DetailedO3CPU()
28    mem_mode = 'timing'
29elif options.timing:
30    cpu = TimingSimpleCPU()
31    cpu2 = TimingSimpleCPU()
32    mem_mode = 'timing'
33else:
34    cpu = AtomicSimpleCPU()
35    cpu2 = AtomicSimpleCPU()
36    mem_mode = 'atomic'
37
38if options.dual:
39    root = DualRoot(
40        MyLinuxAlphaSystem(cpu, mem_mode, linux_image),
41        MyLinuxAlphaSystem(cpu2, mem_mode, linux_image))
42    root.client.readfile = script('netperf-stream-nt-client.rcS')
43    root.server.readfile = script('netperf-server.rcS')
44else:
45    root = TsunamiRoot(clock = '1THz', system = MyLinuxAlphaSystem(cpu, mem_mode, linux_image))
46
47m5.instantiate(root)
48
49#exit_event = m5.simulate(2600000000000)
50#if exit_event.getCause() != "user interrupt received":
51#    m5.checkpoint(root, 'cpt')
52#    exit_event = m5.simulate(300000000000)
53#    if exit_event.getCause() != "user interrupt received":
54#        m5.checkpoint(root, 'cptA')
55
56
57if options.maxtick:
58    exit_event = m5.simulate(options.maxtick)
59elif options.maxtime:
60    simtime = int(options.maxtime * root.clock.value)
61    print "simulating for: ", simtime
62    exit_event = m5.simulate(simtime)
63else:
64    exit_event = m5.simulate()
65
66print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause()
67