Merge vm1.(none):/home/stever/bk/newmem
[gem5.git] / configs / test / test.py
1 import os, optparse, sys
2 import m5
3 from m5.objects import *
4
5 parser = optparse.OptionParser(option_list=m5.standardOptions)
6
7 parser.add_option("-t", "--timing", action="store_true")
8
9 (options, args) = parser.parse_args()
10
11 if args:
12 print "Error: script doesn't take any positional arguments"
13 sys.exit(1)
14
15 this_dir = os.path.dirname(__file__)
16
17 process = AlphaLiveProcess()
18 process.executable = os.path.join(this_dir, 'hello')
19 process.cmd = 'hello'
20
21 magicbus = Bus()
22 mem = PhysicalMemory()
23
24 if options.timing:
25 cpu = TimingSimpleCPU()
26 else:
27 cpu = AtomicSimpleCPU()
28 cpu.workload = process
29 cpu.mem = magicbus
30
31 system = System(physmem = mem, cpu = cpu)
32 system.c1 = Connector(side_a = mem, side_b = magicbus)
33 root = Root(system = system)
34
35 m5.instantiate(root)
36
37 exit_event = m5.simulate()
38
39 print 'Exiting @', m5.curTick(), 'because', exit_event.getCause()
40