Merge zizzer:/bk/m5 into isabel.reinhardt.house:/z/stever/bk/m5

--HG--
extra : convert_revision : 2005ed2f551f2a80cbf62a41daaa3c4fa5af6fb3
This commit is contained in:
Steve Reinhardt 2004-01-27 19:33:59 -08:00
commit 3a85b9db1c
3 changed files with 37 additions and 8 deletions

View file

@ -538,7 +538,7 @@ declare {{
trappingMode((enum TrappingMode)FP_TRAPMODE) trappingMode((enum TrappingMode)FP_TRAPMODE)
{ {
if (trappingMode != Imprecise) { if (trappingMode != Imprecise) {
warn("Warning: precise FP traps unimplemented\n"); warn("precise FP traps unimplemented\n");
} }
} }
@ -1609,7 +1609,7 @@ declare {{
Trace::InstRecord *traceData) Trace::InstRecord *traceData)
{ {
if (!warned) { if (!warned) {
warn("Warning: instruction '%s' unimplemented\n", mnemonic); warn("instruction '%s' unimplemented\n", mnemonic);
warned = true; warned = true;
} }
@ -1620,7 +1620,7 @@ declare {{
Trace::InstRecord *traceData) Trace::InstRecord *traceData)
{ {
if (!xc->spec_mode && !warned) { if (!xc->spec_mode && !warned) {
warn("Warning: instruction '%s' unimplemented\n", mnemonic); warn("instruction '%s' unimplemented\n", mnemonic);
warned = true; warned = true;
} }

View file

@ -42,7 +42,17 @@ void
__panic(const string &format, cp::ArgList &args, const char *func, __panic(const string &format, cp::ArgList &args, const char *func,
const char *file, int line) const char *file, int line)
{ {
string fmt = "panic: " + format + " @ cycle %d\n[%s:%s, line %d]\n"; string fmt = "panic: " + format;
switch (fmt[fmt.size() - 1]) {
case '\n':
case '\r':
break;
default:
fmt += "\n";
}
fmt += " @ cycle %d\n[%s:%s, line %d]\n";
args.append(curTick); args.append(curTick);
args.append(func); args.append(func);
args.append(file); args.append(file);
@ -63,8 +73,18 @@ void
__fatal(const string &format, cp::ArgList &args, const char *func, __fatal(const string &format, cp::ArgList &args, const char *func,
const char *file, int line) const char *file, int line)
{ {
string fmt = "fatal: " + format + " @ cycle %d\n[%s:%s, line %d]\n" string fmt = "fatal: " + format;
"Memory Usage: %ld KBytes\n";
switch (fmt[fmt.size() - 1]) {
case '\n':
case '\r':
break;
default:
fmt += "\n";
}
fmt += " @ cycle %d\n[%s:%s, line %d]\n";
fmt += "Memory Usage: %ld KBytes\n";
args.append(curTick); args.append(curTick);
args.append(func); args.append(func);
@ -83,15 +103,23 @@ __warn(const string &format, cp::ArgList &args, const char *func,
const char *file, int line) const char *file, int line)
{ {
string fmt = "warn: " + format; string fmt = "warn: " + format;
switch (fmt[fmt.size() - 1]) {
case '\n':
case '\r':
break;
default:
fmt += "\n";
}
#ifdef VERBOSE_WARN #ifdef VERBOSE_WARN
fmt += " @ cycle %d\n[%s:%s, line %d]\n"; fmt += " @ cycle %d\n[%s:%s, line %d]\n";
args.append(curTick); args.append(curTick);
args.append(func); args.append(func);
args.append(file); args.append(file);
args.append(line); args.append(line);
#else
fmt += "\n";
#endif #endif
args.dump(cerr, fmt); args.dump(cerr, fmt);
delete &args; delete &args;

View file

@ -400,6 +400,7 @@ main(int argc, char **argv)
} }
SimInit(); SimInit();
warn("Entering event queue. Starting simulation...\n");
while (!mainEventQueue.empty()) { while (!mainEventQueue.empty()) {
assert(curTick <= mainEventQueue.nextTick() && assert(curTick <= mainEventQueue.nextTick() &&