fs.py revision 2934
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("--dual", help="Run full system using dual systems", 16 action="store_true") 17 18(options, args) = parser.parse_args() 19 20if args: 21 print "Error: script doesn't take any positional arguments" 22 sys.exit(1) 23 24if options.detailed: 25 cpu = DetailedO3CPU() 26 cpu2 = DetailedO3CPU() 27 mem_mode = 'Timing' 28elif options.timing: 29 cpu = TimingSimpleCPU() 30 cpu2 = TimingSimpleCPU() 31 mem_mode = 'Timing' 32else: 33 cpu = AtomicSimpleCPU() 34 cpu2 = AtomicSimpleCPU() 35 mem_mode = 'Atomic' 36 37if options.dual: 38 root = DualRoot( 39 MyLinuxAlphaSystem(cpu, mem_mode, linux_image), 40 MyLinuxAlphaSystem(cpu2, mem_mode, linux_image)) 41 root.client.readfile = script('netperf-stream-nt-client.rcS') 42 root.server.readfile = script('netperf-server.rcS') 43else: 44 root = TsunamiRoot(clock = '2GHz', system = MyLinuxAlphaSystem(cpu, mem_mode, linux_image)) 45 46m5.instantiate(root) 47 48#exit_event = m5.simulate(2600000000000) 49#if exit_event.getCause() != "user interrupt received": 50# m5.checkpoint(root, 'cpt') 51# exit_event = m5.simulate(300000000000) 52# if exit_event.getCause() != "user interrupt received": 53# m5.checkpoint(root, 'cptA') 54 55 56if options.maxtick: 57 exit_event = m5.simulate(options.maxtick) 58else: 59 exit_event = m5.simulate() 60 61print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() 62