diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-10-09 18:19:35 -0400 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-10-09 18:19:35 -0400 |
commit | a23c6a719323f2ac74cadd3b04c84f3dc679c26e (patch) | |
tree | 73e081aa0b1868834e8cf4ec98ce5254c6b5192e /configs/example/fs.py | |
parent | 187dcb18bfd87db63ad914d2ba04f0bd2dc0637d (diff) | |
parent | 727dea78c4b603a63d6c8bee10d317cb2905ffd4 (diff) | |
download | gem5-a23c6a719323f2ac74cadd3b04c84f3dc679c26e.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem
into zeep.eecs.umich.edu:/home/gblack/m5/newmem_bus
--HG--
extra : convert_revision : 8267487b935eaf11665841ace3a5c664751b53b0
Diffstat (limited to 'configs/example/fs.py')
-rw-r--r-- | configs/example/fs.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/configs/example/fs.py b/configs/example/fs.py index 5edda6e5f..0dadcbe1b 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -55,6 +55,8 @@ parser.add_option("--etherdump", action="store", type="string", dest="etherdump" "ethernet traffic") parser.add_option("--checkpoint_dir", action="store", type="string", help="Place all checkpoints in this absolute directory") +parser.add_option("-c", "--checkpoint", action="store", type="int", + help="restore from checkpoint <N>") (options, args) = parser.parse_args() @@ -77,6 +79,8 @@ else: cpu.clock = '2GHz' cpu2.clock = '2GHz' +cpu.cpu_id = 0 +cpu2.cpu_id = 0 if options.benchmark: if options.benchmark not in Benchmarks: @@ -113,6 +117,31 @@ else: m5.instantiate(root) +if options.checkpoint: + from os.path import isdir + from os import listdir, getcwd + import re + if options.checkpoint_dir: + cptdir = options.checkpoint_dir + else: + cptdir = getcwd() + + if not isdir(cptdir): + m5.panic("checkpoint dir %s does not exist!" % cptdir) + + dirs = listdir(cptdir) + expr = re.compile('cpt.([0-9]*)') + cpts = [] + for dir in dirs: + match = expr.match(dir) + if match: + cpts.append(match.group(1)) + + if options.checkpoint > len(cpts): + m5.panic('Checkpoint %d not found' % options.checkpoint) + + m5.restoreCheckpoint(root, "/".join([cptdir, "cpt.%s" % cpts[options.checkpoint - 1]])) + if options.maxtick: maxtick = options.maxtick elif options.maxtime: |