cptdir = getcwd()
if options.fast_forward and options.checkpoint_restore != None:
- m5.panic("Error: Can't specify both --fast-forward and --checkpoint-restore")
+ m5.fatal("Error: Can't specify both --fast-forward and --checkpoint-restore")
if options.standard_switch and not options.caches:
- m5.panic("Error: Must specify --caches when using --standard-switch")
+ m5.fatal("Error: Must specify --caches when using --standard-switch")
np = options.num_cpus
max_checkpoints = options.max_checkpoints
# Fast forward to a simpoint (warning: time consuming)
elif options.simpoint:
if testsys.cpu[i].workload[0].simpoint == 0:
- m5.panic('simpoint not found')
+ m5.fatal('simpoint not found')
testsys.cpu[i].max_insts_any_thread = \
testsys.cpu[i].workload[0].simpoint
# No distance specified, just switch
if options.simpoint:
for i in xrange(np):
if testsys.cpu[i].workload[0].simpoint == 0:
- m5.panic('no simpoint for testsys.cpu[%d].workload[0]' % i)
+ m5.fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
testsys.cpu[i].max_insts_any_thread = checkpoint_inst
# used for output below
import re
if not isdir(cptdir):
- m5.panic("checkpoint dir %s does not exist!" % cptdir)
+ m5.fatal("checkpoint dir %s does not exist!", cptdir)
if options.at_instruction:
checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
(options.bench, options.checkpoint_restore))
if not exists(checkpoint_dir):
- m5.panic("Unable to find checkpoint directory %s" % \
+ m5.fatal("Unable to find checkpoint directory %s",
checkpoint_dir)
print "Restoring checkpoint ..."
elif options.simpoint:
# assume workload 0 has the simpoint
if testsys.cpu[0].workload[0].simpoint == 0:
- m5.panic('Unable to find simpoint')
+ m5.fatal('Unable to find simpoint')
options.checkpoint_restore += \
int(testsys.cpu[0].workload[0].simpoint)
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
(options.bench, options.checkpoint_restore))
if not exists(checkpoint_dir):
- m5.panic("Unable to find checkpoint directory %s.%s" % \
- (options.bench, options.checkpoint_restore))
+ m5.fatal("Unable to find checkpoint directory %s.%s",
+ options.bench, options.checkpoint_restore)
print "Restoring checkpoint ..."
m5.restoreCheckpoint(root,checkpoint_dir)
cpt_num = options.checkpoint_restore
if cpt_num > len(cpts):
- m5.panic('Checkpoint %d not found' % cpt_num)
+ m5.fatal('Checkpoint %d not found', cpt_num)
## Adjust max tick based on our starting tick
maxtick = maxtick - int(cpts[cpt_num - 1])
import m5
if not m5.build_env['FULL_SYSTEM']:
- m5.panic("This script requires full-system mode (*_FS).")
+ m5.fatal("This script requires full-system mode (*_FS).")
from m5.objects import *
m5.AddToPath('../common')
elif m5.build_env['TARGET_ISA'] == "x86":
test_sys = makeLinuxX86System(test_mem_mode, bm[0])
else:
- m5.panic("incapable of building non-alpha or non-sparc full system!")
+ m5.fatal("incapable of building non-alpha or non-sparc full system!")
if options.kernel is not None:
test_sys.kernel = binary(options.kernel)
import m5
if m5.build_env['FULL_SYSTEM']:
- m5.panic("This script requires syscall emulation mode (*_SE).")
+ m5.fatal("This script requires syscall emulation mode (*_SE).")
from m5.objects import *
import os, optparse, sys
#include <cstdlib>
#include <iostream>
#include <string>
+#include <zlib.h>
#include "base/cprintf.hh"
#include "base/hostinfo.hh"
default:
format += "\n";
}
+
+ uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt));
format += " @ cycle %d\n[%s:%s, line %d]\n";
format += "Memory Usage: %ld KBytes\n";
+ format += "For more information see: http://www.m5sim.org/%s/%x\n";
args.push_back(curTick);
args.push_back(func);
args.push_back(file);
args.push_back(line);
args.push_back(memUsage());
+ args.push_back(prefix);
+ args.push_back(crc);
ccprintf(cerr, format.c_str(), args);
default:
format += "\n";
}
+
+ uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt));
if (verbose) {
format += " @ cycle %d\n[%s:%s, line %d]\n";
args.push_back(line);
}
+ if (strcmp(prefix, "warn") == 0) {
+ format += "For more information see: http://www.m5sim.org/%s/%x\n";
+ args.push_back(prefix);
+ args.push_back(crc);
+ }
+
ccprintf(stream, format.c_str(), args);
}
for param in param_names:
value = self._values.get(param)
if value is None:
- m5.fatal("%s.%s without default or user set value" \
- % (self.path(), param))
+ m5.fatal("%s.%s without default or user set value",
+ self.path(), param)
value = value.getValue()
if isinstance(self._params[param], VectorParamDesc):
# define this here so we can use it right away if necessary
+def errorURL(prefix, s):
+ try:
+ import zlib
+ hashstr = "%x" % zlib.crc32(s)
+ except:
+ hashstr = "UnableToHash"
+ return "For more information see: http://www.m5sim.org/%s/%s" % \
+ (prefix, hashstr)
+
+
# panic() should be called when something happens that should never
# ever happen regardless of what the user does (i.e., an acutal m5
# bug).
-def panic(string):
- print >>sys.stderr, 'panic:', string
+def panic(fmt, *args):
+ print >>sys.stderr, 'panic:', fmt % args
+ print >>sys.stderr, errorURL('panic',fmt)
sys.exit(1)
# fatal() should be called when the simulation cannot continue due to
# some condition that is the user's fault (bad configuration, invalid
# arguments, etc.) and not a simulator bug.
-def fatal(string):
- print >>sys.stderr, 'fatal:', string
+def fatal(fmt, *args):
+ print >>sys.stderr, 'fatal:', fmt % args
+ print >>sys.stderr, errorURL('fatal',fmt)
sys.exit(1)
# force scalars to one-element lists for uniformity
if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
panic("CheckedInt subclass %s must define either\n" \
- " 'min' and 'max' or 'size' and 'unsigned'\n" \
- % name);
+ " 'min' and 'max' or 'size' and 'unsigned'\n",
+ name);
if cls.unsigned:
cls.min = 0
cls.max = 2 ** cls.size - 1