* Authors: Ali Saidi
*/
+#include "arch/generic/linux/threadinfo.hh"
#include "arch/utility.hh"
-#include "arch/alpha/linux/threadinfo.hh"
-#include "base/cp_annotate.hh"
-#include "base/callback.hh"
#include "base/loader/object_file.hh"
+#include "base/callback.hh"
+#include "base/cp_annotate.hh"
#include "base/output.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
+#include "debug/Annotate.hh"
+#include "debug/AnnotateVerbose.hh"
#include "sim/arguments.hh"
#include "sim/core.hh"
#include "sim/sim_exit.hh"
registerExitCallback(new AnnotateDumpCallback(this));
}
+
+uint64_t
+CPA::getFrame(ThreadContext *tc)
+{
+ // This code is ISA specific and will need to be changed
+ // if the annotation code is used for something other than Alpha
+ return (tc->readMiscRegNoEffect(TheISA::IPR_PALtemp23) &
+ ~ULL(0x3FFF));
+
+}
+
void
CPA::swSmBegin(ThreadContext *tc)
{
StringWrap name(sys->name());
if (!sm[0])
- warn("Got null SM at tick %d\n", curTick);
+ warn("Got null SM at tick %d\n", curTick());
int sysi = getSys(sys);
int smi = getSm(sysi, sm, args[1]);
DPRINTF(Annotate, "Ending machine: %s; end stack: %s\n", sm,
smMap[smib-1].second.first);
- warn("State machine stack not unwinding correctly at %d\n", curTick);
+ warn("State machine stack not unwinding correctly at %d\n", curTick());
} else {
DPRINTF(Annotate,
"State machine ending:%s sysi:%d id:%#x back:%d getSm:%d\n",
DPRINTF(Annotate, "Explict begin of state %s\n", st);
uint32_t flags = args[0];
if (flags & FL_BAD)
- warn("BAD state encountered: at cycle %d: %s\n", curTick, st);
+ warn("BAD state encountered: at cycle %d: %s\n", curTick(), st);
swBegin(tc->getSystemPtr(), tc->contextId(), st, getFrame(tc), true, args[0]);
}
string sym;
Addr sym_addr = 0;
- SymbolTable *symtab = NULL;
-
if (!TheISA::inUserMode(tc)) {
debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
- symtab = debugSymbolTable;
} else {
Linux::ThreadInfo ti(tc);
string app = ti.curTaskName();
warn("%d: Queue Assert: SW said there should be %d byte(s) in %s,"
"however there are %d byte(s)\n",
- curTick, size, q, qBytes[qi-1]);
+ curTick(), size, q, qBytes[qi-1]);
DPRINTF(AnnotateQ, "%d: Queue Assert: SW said there should be %d"
" byte(s) in %s, however there are %d byte(s)\n",
- curTick, size, q, qBytes[qi-1]);
+ curTick(), size, q, qBytes[qi-1]);
}
}
CPA::AnnDataPtr
CPA::add(int t, int f, int c, int sm, int stq, int32_t d)
{
- AnnDataPtr an = new AnnotateData;
- an->time = curTick;
+ AnnDataPtr an = std::make_shared<AnnotateData>();
+ an->time = curTick();
an->data = d;
an->orig_data = d;
an->op = t;
paramIn(cp, section, csprintf("nameCache%d.str", x), str);
paramIn(cp, section, csprintf("nameCache%d.int", x), sysi);
- nameCache[sys] = std::make_pair<std::string,int>(str, sysi);
+ nameCache[sys] = std::make_pair(str, sysi);
}
//smStack (SmStack)
if (!qSize[x])
continue;
for (int y = 0; y < qSize[x]; y++) {
- AnnDataPtr a = new AnnotateData;
+ AnnDataPtr a = std::make_shared<AnnotateData>();
a->unserialize(cp, csprintf("%s.Q%d_%d", section, x, y));
data.push_back(a);
qData[x].push_back(a);