From 868d112578467273a50de3bf926bf0d280eebcd3 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Thu, 5 Oct 2006 13:18:32 -0400 Subject: fix the argument to m5.simulate() on a checkpoint. src/sim/stat_control.cc: add curTick to reset stats printf. --HG-- extra : convert_revision : da8cf5921e81b73f47d6831d539ca1fbdace3d1d --- configs/example/fs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'configs/example/fs.py') diff --git a/configs/example/fs.py b/configs/example/fs.py index 71c5961ef..31b31529f 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -124,6 +124,9 @@ exit_event = m5.simulate(maxtick) while exit_event.getCause() == "checkpoint": m5.checkpoint(root, "cpt.%d") - exit_event = m5.simulate(maxtick - m5.curTick()) + if maxtick == -1: + exit_event = m5.simulate(maxtick) + else: + exit_event = m5.simulate(maxtick - m5.curTick()) print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From 54cf456fd15b6c88010d35ca310b18f7a415114e Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Fri, 6 Oct 2006 00:42:39 -0400 Subject: add an option for defining a directory in which to place all your checkpoints. if none, default is cwd. --HG-- extra : convert_revision : 23a602c2d800c922346c9743cc0c583d178a0ee7 --- configs/example/fs.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'configs/example/fs.py') diff --git a/configs/example/fs.py b/configs/example/fs.py index 31b31529f..5edda6e5f 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -49,10 +49,12 @@ parser.add_option("--dual", action="store_true", parser.add_option("-b", "--benchmark", action="store", type="string", dest="benchmark", help="Specify the benchmark to run. Available benchmarks: %s"\ - % DefinedBenchmarks) + % DefinedBenchmarks) parser.add_option("--etherdump", action="store", type="string", dest="etherdump", - help="Specify the filename to dump a pcap capture of the ethernet" - "traffic") + help="Specify the filename to dump a pcap capture of the" \ + "ethernet traffic") +parser.add_option("--checkpoint_dir", action="store", type="string", + help="Place all checkpoints in this absolute directory") (options, args) = parser.parse_args() @@ -123,7 +125,11 @@ else: exit_event = m5.simulate(maxtick) while exit_event.getCause() == "checkpoint": - m5.checkpoint(root, "cpt.%d") + if options.checkpoint_dir: + m5.checkpoint(root, "/".join([options.checkpoint_dir, "cpt.%d"])) + else: + m5.checkpoint(root, "cpt.%d") + if maxtick == -1: exit_event = m5.simulate(maxtick) else: -- cgit v1.2.3 From 8949d813ff6f9941faf1b173d408e13b0a2440a7 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Sun, 8 Oct 2006 01:12:42 -0400 Subject: Clean up configs. configs/common/FSConfig.py: configs/common/SysPaths.py: configs/example/fs.py: configs/example/se.py: tests/configs/o3-timing-mp.py: tests/configs/o3-timing.py: Clean up configs by removing FullO3Config and instead using default values. src/python/m5/objects/FUPool.py: Add in default FUPool. src/python/m5/objects/O3CPU.py: Use defaults better. Also set checker parameters, and fix up a config bug. --HG-- extra : convert_revision : 5fd0c000143f4881f10a9a575c3810dc97cb290b --- configs/example/fs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configs/example/fs.py') diff --git a/configs/example/fs.py b/configs/example/fs.py index 5edda6e5f..3d3313fbf 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -63,8 +63,8 @@ if args: sys.exit(1) if options.detailed: - cpu = DetailedO3CPU() - cpu2 = DetailedO3CPU() + cpu = DerivO3CPU() + cpu2 = DerivO3CPU() mem_mode = 'timing' elif options.timing: cpu = TimingSimpleCPU() -- cgit v1.2.3 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 ++ 1 file changed, 2 insertions(+) (limited to 'configs/example/fs.py') 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: -- 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/fs.py') 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