Simulation.py (7525:722f2ad014a7) Simulation.py (7530:89b6893554f5)
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
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:
204 checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
205 (options.bench, options.checkpoint_restore))
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))
206 if not exists(checkpoint_dir):
207 fatal("Unable to find checkpoint directory %s", checkpoint_dir)
208
209 print "Restoring checkpoint ..."
210 m5.restoreCheckpoint(checkpoint_dir)
211 print "Done."
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."
212 elif options.simpoint:
213 # assume workload 0 has the simpoint
214 if testsys.cpu[0].workload[0].simpoint == 0:
215 fatal('Unable to find simpoint')
216
217 options.checkpoint_restore += \
218 int(testsys.cpu[0].workload[0].simpoint)
219
220 checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
221 (options.bench, options.checkpoint_restore))
222 if not exists(checkpoint_dir):
223 fatal("Unable to find checkpoint directory %s.%s",
224 options.bench, options.checkpoint_restore)
225
226 print "Restoring checkpoint ..."
227 m5.restoreCheckpoint(checkpoint_dir)
228 print "Done."
229 else:
230 dirs = listdir(cptdir)
231 expr = re.compile('cpt\.([0-9]*)')
232 cpts = []
233 for dir in dirs:
234 match = expr.match(dir)
235 if match:
236 cpts.append(match.group(1))

--- 153 unchanged lines hidden ---
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 ---