Deleted Added
sdiff udiff text old ( 10159:ca6f1407f8f8 ) new ( 10608:427f988fe6e5 )
full compact
1# Copyright (c) 2012-2013 ARM Limited
2# All rights reserved
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 126 unchanged lines hidden (view full) ---

135 # assume workload 0 has the simpoint
136 if testsys.cpu[0].workload[0].simpoint == 0:
137 fatal('Unable to find simpoint')
138 inst += int(testsys.cpu[0].workload[0].simpoint)
139
140 checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % (options.bench, inst))
141 if not exists(checkpoint_dir):
142 fatal("Unable to find checkpoint directory %s", checkpoint_dir)
143 else:
144 dirs = listdir(cptdir)
145 expr = re.compile('cpt\.([0-9]*)')
146 cpts = []
147 for dir in dirs:
148 match = expr.match(dir)
149 if match:
150 cpts.append(match.group(1))
151
152 cpts.sort(lambda a,b: cmp(long(a), long(b)))
153

--- 80 unchanged lines hidden (view full) ---

234 exit_cause = "maximum %d checkpoints dropped" % max_checkpoints
235 break
236
237 exit_event = m5.simulate(maxtick - m5.curTick())
238 exit_cause = exit_event.getCause()
239
240 return exit_event
241
242def repeatSwitch(testsys, repeat_switch_cpu_list, maxtick, switch_freq):
243 print "starting switch loop"
244 while True:
245 exit_event = m5.simulate(switch_freq)
246 exit_cause = exit_event.getCause()
247
248 if exit_cause != "simulate() limit reached":
249 return exit_event

--- 156 unchanged lines hidden (view full) ---

406 options.take_checkpoints = checkpoint_inst
407 else:
408 options.take_checkpoints = offset
409 # Set all test cpus with the right number of instructions
410 # for the upcoming simulation
411 for i in xrange(np):
412 testsys.cpu[i].max_insts_any_thread = offset
413
414 checkpoint_dir = None
415 if options.checkpoint_restore:
416 cpt_starttick, checkpoint_dir = findCptDir(options, cptdir, testsys)
417 m5.instantiate(checkpoint_dir)
418
419 # Handle the max tick settings now that tick frequency was resolved
420 # during system instantiation
421 # NOTE: the maxtick variable here is in absolute ticks, so it must

--- 58 unchanged lines hidden (view full) ---

480 print "Simulation ends instruction count:%d" % \
481 (testsys.switch_cpus_1[0].max_insts_any_thread)
482 m5.switchCpus(testsys, switch_cpu_list1)
483
484 # If we're taking and restoring checkpoints, use checkpoint_dir
485 # option only for finding the checkpoints to restore from. This
486 # lets us test checkpointing by restoring from one set of
487 # checkpoints, generating a second set, and then comparing them.
488 if options.take_checkpoints and options.checkpoint_restore:
489 if m5.options.outdir:
490 cptdir = m5.options.outdir
491 else:
492 cptdir = getcwd()
493
494 if options.take_checkpoints != None :
495 # Checkpoints being taken via the command line at <when> and at
496 # subsequent periods of <period>. Checkpoint instructions
497 # received from the benchmark running are ignored and skipped in
498 # favor of command line checkpoint instructions.
499 exit_event = scriptCheckpoints(options, maxtick, cptdir)
500 else:
501 if options.fast_forward:
502 m5.stats.reset()
503 print "**** REAL SIMULATION ****"
504
505 # If checkpoints are being taken, then the checkpoint instruction
506 # will occur in the benchmark code it self.
507 if options.repeat_switch and maxtick > options.repeat_switch:
508 exit_event = repeatSwitch(testsys, repeat_switch_cpu_list,
509 maxtick, options.repeat_switch)
510 else:
511 exit_event = benchCheckpoints(options, maxtick, cptdir)
512
513 print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_event.getCause())
514 if options.checkpoint_at_end:
515 m5.checkpoint(joinpath(cptdir, "cpt.%d"))
516
517 if not m5.options.interactive:
518 sys.exit(exit_event.getCode())