Simulation.py (9156:38dd0780322a) | Simulation.py (9215:a67412670f37) |
---|---|
1# Copyright (c) 2006-2008 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 139 unchanged lines hidden (view full) --- 148 if cpt_num > len(cpts): 149 fatal('Checkpoint %d not found', cpt_num) 150 151 maxtick = maxtick - int(cpts[cpt_num - 1]) 152 checkpoint_dir = joinpath(cptdir, "cpt.%s" % cpts[cpt_num - 1]) 153 154 return maxtick, checkpoint_dir 155 | 1# Copyright (c) 2006-2008 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 139 unchanged lines hidden (view full) --- 148 if cpt_num > len(cpts): 149 fatal('Checkpoint %d not found', cpt_num) 150 151 maxtick = maxtick - int(cpts[cpt_num - 1]) 152 checkpoint_dir = joinpath(cptdir, "cpt.%s" % cpts[cpt_num - 1]) 153 154 return maxtick, checkpoint_dir 155 |
156def scriptCheckpoints(options, cptdir): | 156def scriptCheckpoints(options, maxtick, cptdir): |
157 if options.at_instruction or options.simpoint: 158 checkpoint_inst = int(options.take_checkpoints) 159 160 # maintain correct offset if we restored from some instruction 161 if options.checkpoint_restore != None: 162 checkpoint_inst += options.checkpoint_restore 163 164 print "Creating checkpoint at inst:%d" % (checkpoint_inst) --- 318 unchanged lines hidden (view full) --- 483 else: 484 cptdir = getcwd() 485 486 if options.take_checkpoints != None : 487 # Checkpoints being taken via the command line at <when> and at 488 # subsequent periods of <period>. Checkpoint instructions 489 # received from the benchmark running are ignored and skipped in 490 # favor of command line checkpoint instructions. | 157 if options.at_instruction or options.simpoint: 158 checkpoint_inst = int(options.take_checkpoints) 159 160 # maintain correct offset if we restored from some instruction 161 if options.checkpoint_restore != None: 162 checkpoint_inst += options.checkpoint_restore 163 164 print "Creating checkpoint at inst:%d" % (checkpoint_inst) --- 318 unchanged lines hidden (view full) --- 483 else: 484 cptdir = getcwd() 485 486 if options.take_checkpoints != None : 487 # Checkpoints being taken via the command line at <when> and at 488 # subsequent periods of <period>. Checkpoint instructions 489 # received from the benchmark running are ignored and skipped in 490 # favor of command line checkpoint instructions. |
491 exit_cause = scriptCheckpoints(options, cptdir) | 491 exit_cause = scriptCheckpoints(options, maxtick, cptdir) |
492 else: 493 if options.fast_forward: 494 m5.stats.reset() 495 print "**** REAL SIMULATION ****" 496 497 # If checkpoints are being taken, then the checkpoint instruction 498 # will occur in the benchmark code it self. 499 if options.repeat_switch and maxtick > options.repeat_switch: 500 exit_cause = repeatSwitch(testsys, repeat_switch_cpu_list, 501 maxtick, options.repeat_switch) 502 else: 503 exit_cause = benchCheckpoints(options, maxtick, cptdir) 504 505 print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_cause) 506 if options.checkpoint_at_end: 507 m5.checkpoint(joinpath(cptdir, "cpt.%d")) | 492 else: 493 if options.fast_forward: 494 m5.stats.reset() 495 print "**** REAL SIMULATION ****" 496 497 # If checkpoints are being taken, then the checkpoint instruction 498 # will occur in the benchmark code it self. 499 if options.repeat_switch and maxtick > options.repeat_switch: 500 exit_cause = repeatSwitch(testsys, repeat_switch_cpu_list, 501 maxtick, options.repeat_switch) 502 else: 503 exit_cause = benchCheckpoints(options, maxtick, cptdir) 504 505 print 'Exiting @ tick %i because %s' % (m5.curTick(), exit_cause) 506 if options.checkpoint_at_end: 507 m5.checkpoint(joinpath(cptdir, "cpt.%d")) |