diff options
Diffstat (limited to 'configs/common')
-rw-r--r-- | configs/common/Caches.py | 1 | ||||
-rw-r--r-- | configs/common/FSConfig.py | 46 | ||||
-rw-r--r-- | configs/common/Options.py | 5 | ||||
-rw-r--r-- | configs/common/Simulation.py | 38 |
4 files changed, 73 insertions, 17 deletions
diff --git a/configs/common/Caches.py b/configs/common/Caches.py index 1c3b089c7..412cfd3b1 100644 --- a/configs/common/Caches.py +++ b/configs/common/Caches.py @@ -26,7 +26,6 @@ # # Authors: Lisa Hsu -import m5 from m5.objects import * class L1Cache(BaseCache): diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py index 180e0ac52..7ab7319cd 100644 --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -26,8 +26,6 @@ # # Authors: Kevin Lim -import m5 -from m5 import makeList from m5.objects import * from Benchmarks import * @@ -81,6 +79,50 @@ def makeLinuxAlphaSystem(mem_mode, mdesc = None): return self +def makeLinuxAlphaRubySystem(mem_mode, rubymem, mdesc = None): + class BaseTsunami(Tsunami): + ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0) + ide = IdeController(disks=[Parent.disk0, Parent.disk2], + pci_func=0, pci_dev=0, pci_bus=0) + + + self = LinuxAlphaSystem(physmem = rubymem) + if not mdesc: + # generic system + mdesc = SysConfig() + self.readfile = mdesc.script() + + # Create pio bus to connect all device pio ports to rubymem's pio port + self.piobus = Bus(bus_id=0) + + self.disk0 = CowIdeDisk(driveID='master') + self.disk2 = CowIdeDisk(driveID='master') + self.disk0.childImage(mdesc.disk()) + self.disk2.childImage(disk('linux-bigswap2.img')) + self.tsunami = BaseTsunami() + self.tsunami.attachIO(self.piobus) + self.tsunami.ide.pio = self.piobus.port + self.tsunami.ethernet.pio = self.piobus.port + + # connect the dma ports directly to ruby dma ports + self.tsunami.ide.dma = self.physmem.dma_port + self.tsunami.ethernet.dma = self.physmem.dma_port + + # connect the pio bus to rubymem + self.physmem.pio_port = self.piobus.port + + self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(), + read_only = True)) + self.intrctrl = IntrControl() + self.mem_mode = mem_mode + self.terminal = Terminal() + self.kernel = binary('vmlinux') + self.pal = binary('ts_osfpal') + self.console = binary('console') + self.boot_osflags = 'root=/dev/hda1 console=ttyS0' + + return self + def makeSparcSystem(mem_mode, mdesc = None): class CowMmDisk(MmDisk): image = CowDiskImage(child=RawDiskImage(read_only=True), diff --git a/configs/common/Options.py b/configs/common/Options.py index 0ddd2f06d..abc26f1b5 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -38,6 +38,7 @@ parser.add_option("--fastmem", action="store_true") # Run duration options parser.add_option("-m", "--maxtick", type="int") parser.add_option("--maxtime", type="float") +parser.add_option("--maxinsts", type="int") parser.add_option("--prog_intvl", type="int") @@ -52,6 +53,9 @@ parser.add_option("--checkpoint-dir", action="store", type="string", help="Place all checkpoints in this absolute directory") parser.add_option("-r", "--checkpoint-restore", action="store", type="int", help="restore from checkpoint <N>") +parser.add_option("--checkpoint-at-end", action="store_true", + help="take a checkpoint at end of run") + # CPU Switching - default switch model goes from a checkpoint # to a timing simple CPU with caches to warm up, then to detailed CPU for @@ -61,6 +65,7 @@ parser.add_option("-s", "--standard-switch", action="store_true", parser.add_option("-w", "--warmup", action="store", type="int", help="if -s, then this is the warmup period. else, this is ignored", default=5000000000) +parser.add_option("--profile", help="CPU profile interval") # Fastforwarding and simpoint related materials parser.add_option("-W", "--warmup-insts", action="store", type="int", diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index d7dde241c..1c9d4ff4e 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -28,9 +28,13 @@ from os import getcwd from os.path import join as joinpath + import m5 +from m5.defines import buildEnv from m5.objects import * -m5.AddToPath('../common') +from m5.util import * + +addToPath('../common') def setCPUClass(options): @@ -82,10 +86,10 @@ def run(options, root, testsys, cpu_class): cptdir = getcwd() if options.fast_forward and options.checkpoint_restore != None: - m5.fatal("Error: Can't specify both --fast-forward and --checkpoint-restore") + fatal("Can't specify both --fast-forward and --checkpoint-restore") if options.standard_switch and not options.caches: - m5.fatal("Error: Must specify --caches when using --standard-switch") + fatal("Must specify --caches when using --standard-switch") np = options.num_cpus max_checkpoints = options.max_checkpoints @@ -95,6 +99,10 @@ def run(options, root, testsys, cpu_class): for i in xrange(np): testsys.cpu[i].progress_interval = options.prog_intvl + if options.maxinsts: + for i in xrange(np): + testsys.cpu[i].max_insts_any_thread = options.maxinsts + if cpu_class: switch_cpus = [cpu_class(defer_registration=True, cpu_id=(np+i)) for i in xrange(np)] @@ -103,7 +111,7 @@ def run(options, root, testsys, cpu_class): if options.fast_forward: testsys.cpu[i].max_insts_any_thread = int(options.fast_forward) switch_cpus[i].system = testsys - if not m5.build_env['FULL_SYSTEM']: + if not buildEnv['FULL_SYSTEM']: switch_cpus[i].workload = testsys.cpu[i].workload switch_cpus[i].clock = testsys.cpu[0].clock # simulation period @@ -122,7 +130,7 @@ def run(options, root, testsys, cpu_class): for i in xrange(np): switch_cpus[i].system = testsys switch_cpus_1[i].system = testsys - if not m5.build_env['FULL_SYSTEM']: + if not buildEnv['FULL_SYSTEM']: switch_cpus[i].workload = testsys.cpu[i].workload switch_cpus_1[i].workload = testsys.cpu[i].workload switch_cpus[i].clock = testsys.cpu[0].clock @@ -137,7 +145,7 @@ def run(options, root, testsys, cpu_class): # Fast forward to a simpoint (warning: time consuming) elif options.simpoint: if testsys.cpu[i].workload[0].simpoint == 0: - m5.fatal('simpoint not found') + fatal('simpoint not found') testsys.cpu[i].max_insts_any_thread = \ testsys.cpu[i].workload[0].simpoint # No distance specified, just switch @@ -170,7 +178,7 @@ def run(options, root, testsys, cpu_class): if options.simpoint: for i in xrange(np): if testsys.cpu[i].workload[0].simpoint == 0: - m5.fatal('no simpoint for testsys.cpu[%d].workload[0]', i) + fatal('no simpoint for testsys.cpu[%d].workload[0]', i) checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset testsys.cpu[i].max_insts_any_thread = checkpoint_inst # used for output below @@ -190,14 +198,13 @@ def run(options, root, testsys, cpu_class): import re if not isdir(cptdir): - m5.fatal("checkpoint dir %s does not exist!", cptdir) + fatal("checkpoint dir %s does not exist!", cptdir) if options.at_instruction: checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \ (options.bench, options.checkpoint_restore)) if not exists(checkpoint_dir): - m5.fatal("Unable to find checkpoint directory %s", - checkpoint_dir) + fatal("Unable to find checkpoint directory %s", checkpoint_dir) print "Restoring checkpoint ..." m5.restoreCheckpoint(root, checkpoint_dir) @@ -205,7 +212,7 @@ def run(options, root, testsys, cpu_class): elif options.simpoint: # assume workload 0 has the simpoint if testsys.cpu[0].workload[0].simpoint == 0: - m5.fatal('Unable to find simpoint') + fatal('Unable to find simpoint') options.checkpoint_restore += \ int(testsys.cpu[0].workload[0].simpoint) @@ -213,8 +220,8 @@ def run(options, root, testsys, cpu_class): checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \ (options.bench, options.checkpoint_restore)) if not exists(checkpoint_dir): - m5.fatal("Unable to find checkpoint directory %s.%s", - options.bench, options.checkpoint_restore) + fatal("Unable to find checkpoint directory %s.%s", + options.bench, options.checkpoint_restore) print "Restoring checkpoint ..." m5.restoreCheckpoint(root,checkpoint_dir) @@ -233,7 +240,7 @@ def run(options, root, testsys, cpu_class): cpt_num = options.checkpoint_restore if cpt_num > len(cpts): - m5.fatal('Checkpoint %d not found', cpt_num) + fatal('Checkpoint %d not found', cpt_num) ## Adjust max tick based on our starting tick maxtick = maxtick - int(cpts[cpt_num - 1]) @@ -367,3 +374,6 @@ def run(options, root, testsys, cpu_class): exit_cause = exit_event.getCause() print 'Exiting @ cycle %i because %s' % (m5.curTick(), exit_cause) + if options.checkpoint_at_end: + m5.checkpoint(root, joinpath(cptdir, "cpt.%d")) + |