Simulation.py (9520:ea7c03ae2d5e) Simulation.py (9521:1cd02decbfd3)
1# Copyright (c) 2012 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

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

237 print "starting switch loop"
238 while True:
239 exit_event = m5.simulate(switch_freq)
240 exit_cause = exit_event.getCause()
241
242 if exit_cause != "simulate() limit reached":
243 return exit_event
244
1# Copyright (c) 2012 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

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

237 print "starting switch loop"
238 while True:
239 exit_event = m5.simulate(switch_freq)
240 exit_cause = exit_event.getCause()
241
242 if exit_cause != "simulate() limit reached":
243 return exit_event
244
245 print "draining the system"
246 m5.drain(testsys)
247 m5.switchCpus(repeat_switch_cpu_list)
248 m5.resume(testsys)
245 m5.switchCpus(testsys, repeat_switch_cpu_list)
249
250 tmp_cpu_list = []
251 for old_cpu, new_cpu in repeat_switch_cpu_list:
252 tmp_cpu_list.append((new_cpu, old_cpu))
253 repeat_switch_cpu_list = tmp_cpu_list
254
255 if (maxtick - m5.curTick()) <= switch_freq:
256 exit_event = m5.simulate(maxtick - m5.curTick())

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

431 print "Switch at instruction count:%s" % \
432 str(testsys.cpu[0].max_insts_any_thread)
433 exit_event = m5.simulate()
434 else:
435 print "Switch at curTick count:%s" % str(10000)
436 exit_event = m5.simulate(10000)
437 print "Switched CPUS @ tick %s" % (m5.curTick())
438
246
247 tmp_cpu_list = []
248 for old_cpu, new_cpu in repeat_switch_cpu_list:
249 tmp_cpu_list.append((new_cpu, old_cpu))
250 repeat_switch_cpu_list = tmp_cpu_list
251
252 if (maxtick - m5.curTick()) <= switch_freq:
253 exit_event = m5.simulate(maxtick - m5.curTick())

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

428 print "Switch at instruction count:%s" % \
429 str(testsys.cpu[0].max_insts_any_thread)
430 exit_event = m5.simulate()
431 else:
432 print "Switch at curTick count:%s" % str(10000)
433 exit_event = m5.simulate(10000)
434 print "Switched CPUS @ tick %s" % (m5.curTick())
435
439 # when you change to Timing (or Atomic), you halt the system
440 # given as argument. When you are finished with the system
441 # changes (including switchCpus), you must resume the system
442 # manually. You DON'T need to resume after just switching
443 # CPUs if you haven't changed anything on the system level.
436 m5.switchCpus(testsys, switch_cpu_list)
444
437
445 m5.changeToTiming(testsys)
446 m5.switchCpus(switch_cpu_list)
447 m5.resume(testsys)
448
449 if options.standard_switch:
450 print "Switch at instruction count:%d" % \
451 (testsys.switch_cpus[0].max_insts_any_thread)
452
453 #warmup instruction count may have already been set
454 if options.warmup_insts:
455 exit_event = m5.simulate()
456 else:
457 exit_event = m5.simulate(options.standard_switch)
458 print "Switching CPUS @ tick %s" % (m5.curTick())
459 print "Simulation ends instruction count:%d" % \
460 (testsys.switch_cpus_1[0].max_insts_any_thread)
438 if options.standard_switch:
439 print "Switch at instruction count:%d" % \
440 (testsys.switch_cpus[0].max_insts_any_thread)
441
442 #warmup instruction count may have already been set
443 if options.warmup_insts:
444 exit_event = m5.simulate()
445 else:
446 exit_event = m5.simulate(options.standard_switch)
447 print "Switching CPUS @ tick %s" % (m5.curTick())
448 print "Simulation ends instruction count:%d" % \
449 (testsys.switch_cpus_1[0].max_insts_any_thread)
461 m5.drain(testsys)
462 m5.switchCpus(switch_cpu_list1)
463 m5.resume(testsys)
450 m5.switchCpus(testsys, switch_cpu_list1)
464
465 # If we're taking and restoring checkpoints, use checkpoint_dir
466 # option only for finding the checkpoints to restore from. This
467 # lets us test checkpointing by restoring from one set of
468 # checkpoints, generating a second set, and then comparing them.
469 if options.take_checkpoints and options.checkpoint_restore:
470 if m5.options.outdir:
471 cptdir = m5.options.outdir

--- 28 unchanged lines hidden ---
451
452 # If we're taking and restoring checkpoints, use checkpoint_dir
453 # option only for finding the checkpoints to restore from. This
454 # lets us test checkpointing by restoring from one set of
455 # checkpoints, generating a second set, and then comparing them.
456 if options.take_checkpoints and options.checkpoint_restore:
457 if m5.options.outdir:
458 cptdir = m5.options.outdir

--- 28 unchanged lines hidden ---