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