From 91c76278b95f74a7a237ba9d89ad2818c2e20a4d Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 8 Oct 2006 19:11:06 -0700 Subject: Set cpu_id params (required by ll/sc code now). --HG-- extra : convert_revision : e0f7ccbeccca191a8edb54494d2b4f9369e9914c --- configs/example/fs.py | 2 ++ configs/example/se.py | 1 + 2 files changed, 3 insertions(+) (limited to 'configs/example') diff --git a/configs/example/fs.py b/configs/example/fs.py index 5edda6e5f..6db26a02a 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -77,6 +77,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: diff --git a/configs/example/se.py b/configs/example/se.py index de8b6c890..d1d19eebc 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -91,6 +91,7 @@ else: cpu = AtomicSimpleCPU() cpu.workload = process +cpu.cpu_id = 0 system = System(cpu = cpu, physmem = PhysicalMemory(), -- cgit v1.2.3 From 67a114fc29662d262a3d7ae867f6ee4c25c0ce8f Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Mon, 9 Oct 2006 00:12:16 -0400 Subject: add in checkpoint restoration option, you can restore a checkpoint by giving a directory, and then giving a checkpoint number, the earliest checkpoint is 1, the latest is N. the default checkpoint directory is the cwd. so you can restore by a command line like this: m5.opt fs.py --checkpoint_dir="/my/ckpt/dir" -c 3 configs/example/fs.py: add in checkpoint restoration option, you can restore a checkpoint by giving a directory, and then giving a checkpoint number, the earliest checkpoint is 1, the latest is N. --HG-- extra : convert_revision : bf9c8d3265a3875cdfb6a878005baa7ae29af90d --- configs/example/fs.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'configs/example') diff --git a/configs/example/fs.py b/configs/example/fs.py index 6db26a02a..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 ") (options, args) = parser.parse_args() @@ -115,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: -- cgit v1.2.3