32 #include "arch/utility.hh" 37 #include "config/the_isa.hh" 39 #include "debug/Annotate.hh" 40 #include "debug/AnnotateVerbose.hh" 50 #define CPA_IGNORE_SYMBOL(sym) { #sym, sizeof(#sym) } 74 #undef CPA_IGNORE_SYMBOL 88 virtual void process();
103 :
SimObject(
p), numSm(0), numSmt(0), numSys(0), numQs(0), conId(0)
106 fatal(
"Multiple annotation objects found in system");
113 i =
p->user_apps.begin();
115 while (i !=
p->user_apps.end()) {
119 fatal(
"Couldn't load symbols from file: %s\n", *i);
121 sf.erase(0, sf.rfind(
'/') + 1);;
122 DPRINTFN(
"file %s short: %s\n", *i, sf);
124 bool result1 =
of->loadGlobalSymbols(userApp[sf]);
125 bool result2 =
of->loadLocalSymbols(userApp[sf]);
126 if (!result1 || !result2)
128 assert(result1 && result2);
138 ah.version = 0x4D35414E00000101
ULL;
141 osbin->write((
char*)&ah,
sizeof(AnnotateHeader));
176 int sysi = getSys(sys);
177 int smi = getSm(sysi, sm, sm_id);
178 DPRINTF(Annotate,
"Starting machine: %s(%d) sysi: %d id: %#x\n", sm,
180 DPRINTF(Annotate,
"smMap[%d] = %d, %s, %#x\n", smi,
181 smMap[smi-1].first, smMap[smi-1].second.first,
182 smMap[smi-1].second.second);
184 uint64_t frame = getFrame(tc);
185 StackId sid = StackId(sysi, frame);
188 if (flags & FL_LINK) {
189 if (smStack[sid].size()) {
190 int prev_smi = smStack[sid].back();
191 DPRINTF(Annotate,
"Linking from %d to state machine %s(%d) [%#x]\n",
192 prev_smi, sm, smi, sm_id);
195 DPRINTF(Annotate,
"LnMap already contains entry for %d of %d\n",
197 assert(lnMap[smi] == 0);
198 lnMap[smi] = prev_smi;
200 add(OP_LINK, FL_NONE, tc->
contextId(), prev_smi, smi);
202 DPRINTF(Annotate,
"Not Linking to state machine %s(%d) [%#x]\n",
208 smStack[sid].push_back(smi);
210 DPRINTF(Annotate,
"Stack Now (%#X):\n", frame);
211 for (
int x = smStack[sid].size()-1;
x >= 0;
x--)
212 DPRINTF(Annotate,
"-- %d\n", smStack[sid][
x]);
219 Id
id = Id(sm, frame);
220 if (scLinks[sysi-1][
id]) {
221 AnnDataPtr an = scLinks[sysi-1][
id];
222 scLinks[sysi-1].erase(
id);
226 "Found prev unknown linking from %d to state machine %s(%d)\n",
230 DPRINTF(Annotate,
"LnMap already contains entry for %d of %d\n",
232 assert(lnMap[smi] == 0);
238 DPRINTF(Annotate,
"st: %s smi: %d stCache.size %d\n", st,
239 smi, stCache.size());
240 int sti = getSt(sm, st);
241 lastState[smi] =
sti;
259 CPA::doSwSmEnd(
System *sys,
int cpuid,
string sm, uint64_t frame)
261 int sysi = getSys(sys);
262 StackId sid = StackId(sysi, frame);
270 int smib = smStack[sid].back();
272 DPRINTF(Annotate,
"Ending machine: %s[%d, %#x] (%d?)\n",
sm, sysi,
275 if (!smStack[sid].size() || smMap[smib-1].second.first !=
sm) {
276 DPRINTF(Annotate,
"State Machine not unwinding correctly. sid: %d, %#x" 277 " top of stack: %s Current Stack:\n",
278 sysi, frame, smMap[smib-1].second.first);
279 for (
int x = smStack[sid].size()-1;
x >= 0;
x--)
280 DPRINTF(Annotate,
"-- %d\n", smStack[sid][
x]);
281 DPRINTF(Annotate,
"Ending machine: %s; end stack: %s\n",
sm,
282 smMap[smib-1].second.first);
284 warn(
"State machine stack not unwinding correctly at %d\n",
curTick());
287 "State machine ending:%s sysi:%d id:%#x back:%d getSm:%d\n",
288 sm, sysi, smMap[smib-1].second.second, smStack[sid].back(),
289 getSm(sysi,
sm, smMap[smib-1].second.second));
290 assert(getSm(sysi,
sm, smMap[smib-1].second.second) ==
291 smStack[sid].back());
293 int smi = smStack[sid].back();
294 smStack[sid].pop_back();
297 DPRINTF(Annotate,
"Linking %d back to %d\n", smi, lnMap[smi]);
298 add(OP_LINK, FL_NONE,
cpuid, smi, lnMap[smi]);
302 if (smStack[sid].size()) {
303 add(OP_BEGIN, FL_NONE,
cpuid, smi, lastState[smi]);
306 DPRINTF(Annotate,
"Stack Now:\n");
307 for (
int x = smStack[sid].size()-1;
x >= 0;
x--)
308 DPRINTF(Annotate,
"-- %d\n", smStack[sid][
x]);
323 DPRINTF(Annotate,
"Explict begin of state %s\n", st);
325 warn(
"BAD state encountered: at cycle %d: %s\n",
curTick(), st);
327 st, getFrame(tc),
true, flags);
344 if (userApp.count(app))
345 userApp[app]->findNearestSymbol(next_pc, sym, sym_addr);
353 CPA::swBegin(
System *sys,
int cpuid, std::string
st, uint64_t frame,
bool expl,
358 while (ignoreSymbols[x].len)
360 len = ignoreSymbols[
x].
len;
361 if (!
st.compare(0,len, ignoreSymbols[x].
symbol, len))
366 int sysi = getSys(sys);
367 StackId sid = StackId(sysi, frame);
369 if (!smStack[sid].size())
371 if (!expl && swExpl[sid])
375 DPRINTFS(AnnotateVerbose, sys,
"SwBegin: %s sysi: %d\n",
st, sysi);
376 int smi = smStack[sid].back();
377 int sti = getSt(smMap[smi-1].second.first,
st);
378 if (lastState[smi] != sti) {
379 lastState[smi] =
sti;
380 add(OP_BEGIN, flags,
cpuid, smi, sti);
398 int sysi = getSys(sys);
399 StackId sid = StackId(sysi, getFrame(tc));
400 if (!smStack[sid].size()) {
401 DPRINTF(Annotate,
"Explict end of State: %s IGNORED\n", st);
404 DPRINTF(Annotate,
"Explict end of State: %s\n", st);
407 int smi = smStack[sid].back();
409 int sti = getSt(smMap[smi-1].second.first, st);
410 lastState[smi] =
sti;
425 int sysi = getSys(sys);
426 StackId sid = StackId(sysi, getFrame(tc));
427 if (!smStack[sid].size())
429 int smi = smStack[sid].back();
432 int qi = getQ(sysi, q,
id);
438 "swQ: %s[%#x] cur size %d %d bytes: %d adding: %d\n",
439 q,
id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
453 int sysi = getSys(sys);
454 StackId sid = StackId(sysi, getFrame(tc));
455 if (!smStack[sid].size())
457 int smi = smStack[sid].back();
458 int qi = getQ(sysi, q,
id);
462 "swDq: %s[%#x] cur size %d %d bytes: %d removing: %d\n",
463 q,
id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
479 int sysi = getSys(sys);
480 StackId sid = StackId(sysi, getFrame(tc));
481 if (!smStack[sid].size())
483 int smi = smStack[sid].back();
484 int qi = getQ(sysi, q,
id);
488 "swPq: %s [%#x] cur size %d %d bytes: %d peeking: %d\n",
489 q,
id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
492 if (qBytes[qi-1] < count) {
495 fatal(
"Queue %s peeking with not enough bytes available in queue!\n", q);
511 int sysi = getSys(sys);
512 StackId sid = StackId(sysi, getFrame(tc));
513 if (!smStack[sid].size())
515 int smi = smStack[sid].back();
516 int qi = getQ(sysi, q,
id);
520 "swRq: %s [%#x] cur size %d %d bytes: %d reserve: %d\n",
521 q,
id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
540 int sysi = getSys(sys);
541 StackId sid = StackId(sysi, getFrame(tc));
542 if (!smStack[sid].size())
544 int smi = smStack[sid].back();
545 int qi = getQ(sysi, q,
id);
566 int sysi = getSys(sys);
567 StackId sid = StackId(sysi, getFrame(tc));
568 if (!smStack[sid].size())
570 int smi = smStack[sid].back();
571 int qi = getQ(sysi, q,
id);
593 int sysi = getSys(sys);
594 StackId sid = StackId(sysi, getFrame(tc));
595 if (!smStack[sid].size())
597 int smi = smStack[sid].back();
598 int qi = getQ(sysi, q,
id);
599 DPRINTF(AnnotateQ,
"swSq: %s [%#x] cur size: %d bytes: %d, new size: %d\n",
600 q,
id, qSize[qi-1], qBytes[qi-1], size);
602 if (FL_RESET & flags) {
603 DPRINTF(AnnotateQ,
"Resetting Queue %s\n", q);
604 add(OP_SIZE_QUEUE, FL_NONE, tc->
contextId(), smi, qi, 0);
610 if (qBytes[qi-1] < size)
611 doQ(sys, FL_NONE, tc->
contextId(), smi,
q, qi, size - qBytes[qi-1]);
612 else if (qBytes[qi-1] > size) {
613 DPRINTF(AnnotateQ,
"removing for resize of queue %s\n", q);
614 add(OP_SIZE_QUEUE, FL_NONE, tc->
contextId(), smi, qi, size);
621 int need = qBytes[qi-1] - size;
624 int32_t tail_bytes = qData[qi-1].back()->data;
625 if (qSize[qi-1] <= 0 || qBytes[qi-1] < 0) {
628 fatal(
"Queue %s had inconsistancy when doing size queue!\n", q);
630 if (tail_bytes > need) {
631 qData[qi-1].back()->data -= need;
633 }
else if (tail_bytes == need) {
634 qData[qi-1].pop_back();
638 qData[qi-1].pop_back();
657 int sysi = getSys(sys);
658 int qi = getQ(sysi, q,
id);
659 if (qBytes[qi-1] != size) {
660 DPRINTF(AnnotateQ,
"Queue %s [%#x] has inconsintant size\n", q,
id);
665 while (ai != qData[qi-1].end()) {
666 DPRINTF(AnnotateQ,
"--Element %d size %d\n", x, (*ai)->data);
671 warn(
"%d: Queue Assert: SW said there should be %d byte(s) in %s," 672 "however there are %d byte(s)\n",
673 curTick(), size, q, qBytes[qi-1]);
674 DPRINTF(AnnotateQ,
"%d: Queue Assert: SW said there should be %d" 675 " byte(s) in %s, however there are %d byte(s)\n",
676 curTick(), size, q, qBytes[qi-1]);
691 int sysi = getSys(sys);
692 StackId sid = StackId(sysi, getFrame(tc));
693 if (!smStack[sid].size())
695 int smi = smStack[sid].back();
696 int lsmi = getSm(sysi, lsm, lsm_id);
698 DPRINTF(Annotate,
"Linking from %d to state machine %s(%d) [%#x]\n",
699 smi, lsm, lsmi, lsm_id);
702 DPRINTF(Annotate,
"LnMap already contains entry for %d of %d\n",
704 assert(lnMap[lsmi] == 0);
707 add(OP_LINK, FL_NONE, tc->
contextId(), smi, lsmi);
723 StackId sid = StackId(sysi, getFrame(tc));
724 if (!smStack[sid].size())
726 int smi = smStack[sid].back();
730 add(OP_IDENT, FL_NONE, tc->
contextId(), smi, 0, smi_string);
739 uint64_t
id = ++conId;
741 StackId sid = StackId(sysi, getFrame(tc));
742 if (!smStack[sid].size())
743 panic(
"swGetId called without a state machine stack!");
744 int smi = smStack[sid].back();
748 add(OP_IDENT, FL_NONE, tc->
contextId(), smi, 0,
id);
763 int sysi = getSys(sys);
765 Id
id = Id(lsm, getFrame(tc));
766 StackId sid = StackId(sysi, getFrame(tc));
768 if (!smStack[sid].size())
771 int smi = smStack[sid].back();
773 DPRINTF(Annotate,
"Linking from %d to state machine %s(UNKNOWN)\n",
776 if (scLinks[sysi-1][
id])
778 "scLinks already contains entry for system %d %s[%x] of %d\n",
779 sysi, lsm, getFrame(tc), scLinks[sysi-1][
id]);
780 assert(scLinks[sysi-1][
id] == 0);
781 scLinks[sysi-1][
id] = add(OP_LINK, FL_NONE, tc->
contextId(), smi, 0xFFFF);
782 scLinks[sysi-1][
id]->dump =
false;
792 CPA::add(
int t,
int f,
int c,
int sm,
int stq, int32_t
d)
794 AnnDataPtr an = std::make_shared<AnnotateData>();
807 DPRINTF(AnnotateVerbose,
"Annotate: op: %d flags: 0x%x sm: %d state: %d time: %d, data: %d\n",
808 an->op, an->flag, an->sm, an->stq, an->time, an->data);
811 if (an->op != OP_LINK)
820 std::streampos curpos = osbin->tellp();
824 *osbin <<
"# Automatically generated state machine descriptor file" << endl;
826 *osbin <<
"sms = {}" << endl << endl;
828 state_machines.resize(numSmt+1);
831 SCache::iterator
i = smtCache.begin();
832 while (i != smtCache.end()) {
833 state_machines[i->second] = i->first;
837 for (
int x = 1;
x < state_machines.size();
x++) {
839 states.resize(numSt[
x-1]+1);
840 assert(
x-1 < stCache.size());
841 SCache::iterator i = stCache[
x-1].begin();
842 while (i != stCache[
x-1].end()) {
843 states[i->second] = i->first;
846 *osbin <<
"sms[\"" << state_machines[
x] <<
"\"] = [\"NULL\"";
847 for (
int y = 1; y < states.size(); y++)
848 *osbin <<
", \"" << states[y] <<
"\"";
849 *osbin <<
"]" << endl;
852 *osbin << endl << endl << endl;
855 *osbin <<
"smNum = [\"NULL\"";
856 for (
int x = 0;
x < smMap.size();
x++)
857 *osbin <<
", (" << smMap[
x].first <<
", \"" << smMap[
x].second.first <<
858 "\", " << smMap[
x].second.second <<
")";
859 *osbin <<
"]" << endl;
861 *osbin << endl << endl << endl;
865 systems.resize(numSys+1);
866 NameCache::iterator i2 = nameCache.begin();
867 while (i2 != nameCache.end()) {
868 systems[i2->second.second] = i2->second.first;
872 *osbin <<
"sysNum = [\"NULL\"";
873 for (
int x = 1;
x < systems.size();
x++) {
874 *osbin <<
", \"" << systems[
x] <<
"\"";
876 *osbin <<
"]" << endl;
879 *osbin <<
"queues = [\"NULL\"";
880 for (
int x = 0;
x < qMap.size();
x++)
881 *osbin <<
", (" << qMap[
x].first <<
", \"" << qMap[
x].second.first <<
882 "\", " << qMap[
x].second.second <<
")";
883 *osbin <<
"]" << endl;
885 *osbin <<
"smComb = [s for s in [(i,r) for i in xrange(1,len(sysNum)) " 886 <<
"for r in xrange (1,len(smNum))]]" << endl;
887 ah.key_len = osbin->tellp() - curpos;
890 curpos = osbin->tellp();
893 for (
int x = 0;
x < annotateIdx.size();
x++)
894 osbin->write((
char*)&annotateIdx[
x],
sizeof(uint64_t));
895 ah.idx_len = osbin->tellp() - curpos;
898 osbin->write((
char*)&ah,
sizeof(AnnotateHeader));
915 if (!all &&
data.size() < 10000)
919 while (i !=
data.end()) {
923 if (!an->dump && !all)
927 if (ah.num_recs % 100000 == 0)
928 annotateIdx.push_back(osbin->tellp());
931 osbin->write((
char*)&(an->time),
sizeof(an->time));
932 osbin->write((
char*)&(an->orig_data),
sizeof(an->orig_data));
933 osbin->write((
char*)&(an->sm),
sizeof(an->sm));
934 osbin->write((
char*)&(an->stq),
sizeof(an->stq));
935 osbin->write((
char*)&(an->op),
sizeof(an->op));
936 osbin->write((
char*)&(an->flag),
sizeof(an->flag));
937 osbin->write((
char*)&(an->cpu),
sizeof(an->cpu));
940 if (
data.begin() !=
i)
949 string q,
int qi,
int count)
952 qBytes[qi-1] +=
count;
953 if (qSize[qi-1] > 2501 || qBytes[qi-1] > 2000000000)
954 warn(
"Queue %s is %d elements/%d bytes, " 955 "maybe things aren't being removed?\n",
956 q, qSize[qi-1], qBytes[qi-1]);
958 qData[qi-1].push_front(add(OP_QUEUE, flags,
cpuid,
sm, qi, count));
960 qData[qi-1].push_back(add(OP_QUEUE, flags,
cpuid,
sm, qi, count));
961 DPRINTFS(AnnotateQ, sys,
"Queing in queue %s size now %d/%d\n",
962 q, qSize[qi-1], qBytes[qi-1]);
963 assert(qSize[qi-1] >= 0);
964 assert(qBytes[qi-1] >= 0);
970 string q,
int qi,
int count)
975 add(OP_DEQUEUE, flags,
cpuid,
sm, qi, count);
979 DPRINTF(AnnotateQ,
"Dequeing all data in queue %s size now %d/%d\n",
980 q, qSize[qi-1], qBytes[qi-1]);
985 if (qSize[qi-1] <= 0 || qBytes[qi-1] <= 0 || !qData[qi-1].size()) {
988 fatal(
"Queue %s dequing with no data available in queue!\n",
991 assert(qSize[qi-1] >= 0);
992 assert(qBytes[qi-1] >= 0);
993 assert(qData[qi-1].size());
995 int32_t need =
count;
996 qBytes[qi-1] -=
count;
997 if (qBytes[qi-1] < 0) {
1000 fatal(
"Queue %s dequing with no bytes available in queue!\n",
1005 int32_t head_bytes = qData[qi-1].front()->data;
1006 if (qSize[qi-1] <= 0 || qBytes[qi-1] < 0) {
1009 fatal(
"Queue %s dequing with nothing in queue!\n",
1013 if (head_bytes > need) {
1014 qData[qi-1].front()->data -= need;
1016 }
else if (head_bytes == need) {
1017 qData[qi-1].pop_front();
1021 qData[qi-1].pop_front();
1027 add(OP_DEQUEUE, flags,
cpuid,
sm, qi, count);
1028 DPRINTF(AnnotateQ,
"Dequeing in queue %s size now %d/%d\n",
1029 q, qSize[qi-1], qBytes[qi-1]);
1055 i = smtCache.begin();
1056 while (i != smtCache.end()) {
1063 for (x = 0; x < stCache.size(); x++) {
1064 i = stCache[
x].begin();
1066 while (i != stCache[x].end()) {
1074 IdHCache::iterator idi;
1075 for (x = 0; x < qCache.size(); x++) {
1076 idi = qCache[
x].begin();
1078 while (idi != qCache[x].end()) {
1087 for (x = 0; x < smCache.size(); x++) {
1088 idi = smCache[
x].begin();
1091 while (idi != smCache[x].end()) {
1103 NameCache::iterator
ni;
1105 ni = nameCache.begin();
1107 while (ni != nameCache.end()) {
1115 SmStack::iterator
si;
1116 si = smStack.begin();
1118 paramOut(
os,
"smStackIdCount", smStack.size());
1119 while (si != smStack.end()) {
1123 for (y = 0; y < si->second.size(); y++)
1130 LinkMap::iterator
li;
1133 while (li != lnMap.end()) {
1140 SwExpl::iterator swexpli;
1141 swexpli = swExpl.begin();
1144 while (swexpli != swExpl.end()) {
1154 ii = lastState.begin();
1155 paramOut(
os,
"lastStateSize", lastState.size());
1156 while (ii != lastState.end()) {
1163 for (x = 0; x < smMap.size(); x++) {
1170 for (x = 0; x < qMap.size(); x++) {
1177 for (x = 0; x < qData.size(); x++) {
1178 if (!qData[x].size())
1181 for (
auto &ann : qData[x]) {
1182 ann->serializeSection(
os,
csprintf(
"Q%d_%d", x, y));
1205 for (
int x = 0;
x < numSmt;
x++) {
1208 smtCache[str] = smi;
1212 stCache.resize(numSmt);
1213 for (
int x = 0;
x < numSmt;
x++) {
1214 for (
int y = 0; y < numSt[
x]; y++) {
1217 stCache[
x][str] = smi;
1223 qCache.resize(numSys);
1224 for (
int x = 0;
x < numSys;
x++) {
1225 for (
int y = 0; y < numQ[
x]; y++) {
1229 qCache[
x][Id(str,
id)] = smi;
1234 smCache.resize(numSys);
1235 for (
int x = 0;
x < numSys;
x++) {
1238 for (
int y = 0; y < size; y++) {
1242 smCache[
x][Id(str,
id)] = smi;
1247 for (
int x = 0;
x < numSys;
x++)
1248 scLinks.push_back(ScHCache());
1251 for (
int x = 0;
x < numSys;
x++) {
1258 sys =
dynamic_cast<System*
>(sptr);
1262 nameCache[sys] = std::make_pair(str, sysi);
1267 paramIn(cp,
"smStackIdCount", smStack_size);
1268 for (
int x = 0;
x < smStack_size;
x++) {
1275 StackId sid = StackId(sysi, frame);
1276 for (
int y = 0; y <
count; y++) {
1278 smStack[sid].push_back(smi);
1285 paramIn(cp,
"lnMapSize", lnMap_size);
1286 for (
int x = 0;
x < lnMap_size;
x++) {
1294 paramIn(cp,
"swExplCount", swExpl_size);
1295 for (
int x = 0;
x < swExpl_size;
x++) {
1302 StackId sid = StackId(sysi, frame);
1309 paramIn(cp,
"lastStateSize", lastState_size);
1310 for (
int x = 0;
x < lastState_size;
x++) {
1313 lastState[smi] =
sti;
1318 smMap.resize(numSm);
1319 for (
int x = 0;
x < smMap.size();
x++) {
1327 for (
int x = 0;
x < qMap.size();
x++) {
1335 qData.resize(qSize.size());
1336 for (
int x = 0;
x < qSize.size();
x++) {
1339 for (
int y = 0; y < qSize[
x]; y++) {
1340 AnnDataPtr
a = std::make_shared<AnnotateData>();
1341 a->unserializeSection(cp,
csprintf(
"Q%d_%d", x, y));
1343 qData[
x].push_back(a);
1377 return new CPA(
this);
#define panic(...)
This implements a cprintf based panic() function.
void swExplictBegin(ThreadContext *tc, int32_t flags, Addr st_string)
void swWf(ThreadContext *tc, Addr id, Addr q_string, Addr sm_string, int32_t count)
virtual System * getSystemPtr()=0
ObjectFile * createObjectFile(const std::string &fname, bool raw)
void swWe(ThreadContext *tc, Addr id, Addr q_string, Addr sm_string, int32_t count)
#define UNSERIALIZE_CONTAINER(member)
#define fatal(...)
This implements a cprintf based fatal() function.
const std::string & name()
void swSq(ThreadContext *tc, Addr id, Addr q_string, int32_t size, int32_t flags)
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
void swSmBegin(ThreadContext *tc, Addr sm_string, int32_t sm_id, int32_t flags)
virtual RegVal readIntReg(RegIndex reg_idx) const =0
virtual PortProxy & getVirtProxy()=0
Overload hash function for BasicBlockRange type.
bool findNearestSymbol(Addr addr, std::string &symbol, Addr &symaddr, Addr &nextaddr) const
Find the nearest symbol equal to or less than the supplied address (e.g., the label for the enclosing...
ThreadContext is the external interface to all thread state for anything outside of the CPU...
uint64_t swGetId(ThreadContext *tc)
#define UNSERIALIZE_SCALAR(scalar)
void swAutoBegin(ThreadContext *tc, Addr next_pc)
Tick curTick()
The current simulated tick.
std::string csprintf(const char *format, const Args &...args)
void swAq(ThreadContext *tc, Addr id, Addr q_string, int32_t size)
const int ReturnAddressReg
void swQ(ThreadContext *tc, Addr id, Addr q_string, int32_t count)
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
void swPq(ThreadContext *tc, Addr id, Addr q_string, int32_t count)
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
void registerExitCallback(Callback *callback)
Register an exit callback.
void swSmEnd(ThreadContext *tc, Addr sm_string)
void arrayParamOut(CheckpointOut &cp, const std::string &name, const CircleBuf< T > ¶m)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
#define CPA_IGNORE_SYMBOL(sym)
void swSyscallLink(ThreadContext *tc, Addr lsm_string, Addr sm_string)
void swLink(ThreadContext *tc, Addr lsm_string, Addr lsm_id, Addr sm_string)
static bool inUserMode(CPSR cpsr)
void swDq(ThreadContext *tc, Addr id, Addr q_string, int32_t count)
#define SERIALIZE_SCALAR(scalar)
void swEnd(ThreadContext *tc)
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
virtual const std::string name() const
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
std::ostream CheckpointOut
CPAIgnoreSymbol ignoreSymbols[]
void swIdentify(ThreadContext *tc, Addr smi_string)
virtual ContextID contextId() const =0
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
std::string curTaskName(Addr thread_info=0)
virtual void process()
virtual process function that is invoked when the callback queue is executed.
SymbolTable * debugSymbolTable
Global unified debugging symbol table (for target).
void unserialize(ThreadContext &tc, CheckpointIn &cp)
void dump()
Dump all statistics data to the registered outputs.
void swRq(ThreadContext *tc, Addr id, Addr q_string, int32_t count)
AnnotateDumpCallback(CPA *_cpa)
Abstract superclass for simulation objects.
void objParamIn(CheckpointIn &cp, const string &name, SimObject *¶m)