1# Copyright (c) 2006-2008 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 176 unchanged lines hidden (view full) --- 185 options.take_checkpoints = checkpoint_inst 186 else: 187 options.take_checkpoints = offset 188 # Set all test cpus with the right number of instructions 189 # for the upcoming simulation 190 for i in xrange(np): 191 testsys.cpu[i].max_insts_any_thread = offset 192 |
193 checkpoint_dir = None |
194 if options.checkpoint_restore != None: 195 from os.path import isdir, exists 196 from os import listdir 197 import re 198 199 if not isdir(cptdir): 200 fatal("checkpoint dir %s does not exist!", cptdir) 201 --- 4 unchanged lines hidden (view full) --- 206 if testsys.cpu[0].workload[0].simpoint == 0: 207 fatal('Unable to find simpoint') 208 inst += int(testsys.cpu[0].workload[0].simpoint) 209 210 checkpoint_dir = joinpath(cptdir, 211 "cpt.%s.%s" % (options.bench, inst)) 212 if not exists(checkpoint_dir): 213 fatal("Unable to find checkpoint directory %s", checkpoint_dir) |
214 else: 215 dirs = listdir(cptdir) 216 expr = re.compile('cpt\.([0-9]*)') 217 cpts = [] 218 for dir in dirs: 219 match = expr.match(dir) 220 if match: 221 cpts.append(match.group(1)) 222 223 cpts.sort(lambda a,b: cmp(long(a), long(b))) 224 225 cpt_num = options.checkpoint_restore 226 227 if cpt_num > len(cpts): 228 fatal('Checkpoint %d not found', cpt_num) 229 230 ## Adjust max tick based on our starting tick 231 maxtick = maxtick - int(cpts[cpt_num - 1]) |
232 checkpoint_dir = joinpath(cptdir, "cpt.%s" % cpts[cpt_num - 1]) |
233 |
234 m5.instantiate(checkpoint_dir) |
235 236 if options.standard_switch or cpu_class: 237 if options.standard_switch: 238 print "Switch at instruction count:%s" % \ 239 str(testsys.cpu[0].max_insts_any_thread) 240 exit_event = m5.simulate() 241 elif cpu_class and options.fast_forward: 242 print "Switch at instruction count:%s" % \ --- 131 unchanged lines hidden --- |