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 --- 186 unchanged lines hidden (view full) --- 195 if options.checkpoint_restore != None: 196 from os.path import isdir, exists 197 from os import listdir 198 import re 199 200 if not isdir(cptdir): 201 fatal("checkpoint dir %s does not exist!", cptdir) 202 |
203 if options.at_instruction or options.simpoint: 204 inst = options.checkpoint_restore 205 if options.simpoint: 206 # assume workload 0 has the simpoint 207 if testsys.cpu[0].workload[0].simpoint == 0: 208 fatal('Unable to find simpoint') 209 inst += int(testsys.cpu[0].workload[0].simpoint) 210 211 checkpoint_dir = joinpath(cptdir, 212 "cpt.%s.%s" % (options.bench, inst)) |
213 if not exists(checkpoint_dir): 214 fatal("Unable to find checkpoint directory %s", checkpoint_dir) 215 216 print "Restoring checkpoint ..." 217 m5.restoreCheckpoint(checkpoint_dir) 218 print "Done." |
219 else: 220 dirs = listdir(cptdir) 221 expr = re.compile('cpt\.([0-9]*)') 222 cpts = [] 223 for dir in dirs: 224 match = expr.match(dir) 225 if match: 226 cpts.append(match.group(1)) --- 153 unchanged lines hidden --- |