cp_annotate.cc (10905:a6ca6831e775) cp_annotate.cc (11320:42ecb523c64a)
1/*
2 * Copyright (c) 2006-2009 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 166 unchanged lines hidden (view full) ---

175
176 if (!sm[0])
177 warn("Got null SM at tick %d\n", curTick());
178
179 int sysi = getSys(sys);
180 int smi = getSm(sysi, sm, args[1]);
181 DPRINTF(Annotate, "Starting machine: %s(%d) sysi: %d id: %#x\n", sm,
182 smi, sysi, args[1]);
1/*
2 * Copyright (c) 2006-2009 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 166 unchanged lines hidden (view full) ---

175
176 if (!sm[0])
177 warn("Got null SM at tick %d\n", curTick());
178
179 int sysi = getSys(sys);
180 int smi = getSm(sysi, sm, args[1]);
181 DPRINTF(Annotate, "Starting machine: %s(%d) sysi: %d id: %#x\n", sm,
182 smi, sysi, args[1]);
183 DPRINTF(Annotate, "smMap[%d] = %d, %s, %#x\n", smi,
184 smMap[smi-1].first, smMap[smi-1].second.first,
183 DPRINTF(Annotate, "smMap[%d] = %d, %s, %#x\n", smi,
184 smMap[smi-1].first, smMap[smi-1].second.first,
185 smMap[smi-1].second.second);
186
187 uint64_t frame = getFrame(tc);
188 StackId sid = StackId(sysi, frame);
189
190 // check if we need to link to the previous state machine
191 int flags = args[2];
192 if (flags & FL_LINK) {

--- 28 unchanged lines hidden (view full) ---

221
222
223 Id id = Id(sm, frame);
224 if (scLinks[sysi-1][id]) {
225 AnnDataPtr an = scLinks[sysi-1][id];
226 scLinks[sysi-1].erase(id);
227 an->stq = smi;
228 an->dump = true;
185 smMap[smi-1].second.second);
186
187 uint64_t frame = getFrame(tc);
188 StackId sid = StackId(sysi, frame);
189
190 // check if we need to link to the previous state machine
191 int flags = args[2];
192 if (flags & FL_LINK) {

--- 28 unchanged lines hidden (view full) ---

221
222
223 Id id = Id(sm, frame);
224 if (scLinks[sysi-1][id]) {
225 AnnDataPtr an = scLinks[sysi-1][id];
226 scLinks[sysi-1].erase(id);
227 an->stq = smi;
228 an->dump = true;
229 DPRINTF(Annotate,
229 DPRINTF(Annotate,
230 "Found prev unknown linking from %d to state machine %s(%d)\n",
231 an->sm, sm, smi);
232
233 if (lnMap[smi])
234 DPRINTF(Annotate, "LnMap already contains entry for %d of %d\n",
235 smi, lnMap[smi]);
236 assert(lnMap[smi] == 0);
237 lnMap[smi] = an->sm;

--- 45 unchanged lines hidden (view full) ---

283 sysi, frame, smMap[smib-1].second.first);
284 for (int x = smStack[sid].size()-1; x >= 0; x--)
285 DPRINTF(Annotate, "-- %d\n", smStack[sid][x]);
286 DPRINTF(Annotate, "Ending machine: %s; end stack: %s\n", sm,
287 smMap[smib-1].second.first);
288
289 warn("State machine stack not unwinding correctly at %d\n", curTick());
290 } else {
230 "Found prev unknown linking from %d to state machine %s(%d)\n",
231 an->sm, sm, smi);
232
233 if (lnMap[smi])
234 DPRINTF(Annotate, "LnMap already contains entry for %d of %d\n",
235 smi, lnMap[smi]);
236 assert(lnMap[smi] == 0);
237 lnMap[smi] = an->sm;

--- 45 unchanged lines hidden (view full) ---

283 sysi, frame, smMap[smib-1].second.first);
284 for (int x = smStack[sid].size()-1; x >= 0; x--)
285 DPRINTF(Annotate, "-- %d\n", smStack[sid][x]);
286 DPRINTF(Annotate, "Ending machine: %s; end stack: %s\n", sm,
287 smMap[smib-1].second.first);
288
289 warn("State machine stack not unwinding correctly at %d\n", curTick());
290 } else {
291 DPRINTF(Annotate,
291 DPRINTF(Annotate,
292 "State machine ending:%s sysi:%d id:%#x back:%d getSm:%d\n",
293 sm, sysi, smMap[smib-1].second.second, smStack[sid].back(),
294 getSm(sysi, sm, smMap[smib-1].second.second));
292 "State machine ending:%s sysi:%d id:%#x back:%d getSm:%d\n",
293 sm, sysi, smMap[smib-1].second.second, smStack[sid].back(),
294 getSm(sysi, sm, smMap[smib-1].second.second));
295 assert(getSm(sysi, sm, smMap[smib-1].second.second) ==
295 assert(getSm(sysi, sm, smMap[smib-1].second.second) ==
296 smStack[sid].back());
297
298 int smi = smStack[sid].back();
299 smStack[sid].pop_back();
300
301 if (lnMap[smi]) {
302 DPRINTF(Annotate, "Linking %d back to %d\n", smi, lnMap[smi]);
303 add(OP_LINK, FL_NONE, cpuid, smi, lnMap[smi]);

--- 91 unchanged lines hidden (view full) ---

395
396 std::string st;
397 Addr junk;
398 if (!TheISA::inUserMode(tc))
399 debugSymbolTable->findNearestSymbol(
400 tc->readIntReg(ReturnAddressReg), st, junk);
401 System *sys = tc->getSystemPtr();
402 StringWrap name(sys->name());
296 smStack[sid].back());
297
298 int smi = smStack[sid].back();
299 smStack[sid].pop_back();
300
301 if (lnMap[smi]) {
302 DPRINTF(Annotate, "Linking %d back to %d\n", smi, lnMap[smi]);
303 add(OP_LINK, FL_NONE, cpuid, smi, lnMap[smi]);

--- 91 unchanged lines hidden (view full) ---

395
396 std::string st;
397 Addr junk;
398 if (!TheISA::inUserMode(tc))
399 debugSymbolTable->findNearestSymbol(
400 tc->readIntReg(ReturnAddressReg), st, junk);
401 System *sys = tc->getSystemPtr();
402 StringWrap name(sys->name());
403
403
404 int sysi = getSys(sys);
405 StackId sid = StackId(sysi, getFrame(tc));
406 if (!smStack[sid].size()) {
407 DPRINTF(Annotate, "Explict end of State: %s IGNORED\n", st);
408 return;
409 }
410 DPRINTF(Annotate, "Explict end of State: %s\n", st);
411 // return back to symbol table based states

--- 26 unchanged lines hidden (view full) ---

438 int smi = smStack[sid].back();
439 if (swExpl[sid])
440 swExpl[sid] = false;
441 int qi = getQ(sysi, q, id);
442 if (count == 0) {
443 //warn("Tried to queue 0 bytes in %s, ignoring\n", q);
444 return;
445 }
404 int sysi = getSys(sys);
405 StackId sid = StackId(sysi, getFrame(tc));
406 if (!smStack[sid].size()) {
407 DPRINTF(Annotate, "Explict end of State: %s IGNORED\n", st);
408 return;
409 }
410 DPRINTF(Annotate, "Explict end of State: %s\n", st);
411 // return back to symbol table based states

--- 26 unchanged lines hidden (view full) ---

438 int smi = smStack[sid].back();
439 if (swExpl[sid])
440 swExpl[sid] = false;
441 int qi = getQ(sysi, q, id);
442 if (count == 0) {
443 //warn("Tried to queue 0 bytes in %s, ignoring\n", q);
444 return;
445 }
446 DPRINTFS(AnnotateQ, sys,
446 DPRINTFS(AnnotateQ, sys,
447 "swQ: %s[%#x] cur size %d %d bytes: %d adding: %d\n",
448 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
449 doQ(sys, FL_NONE, tc->contextId(), smi, q, qi, count);
450}
451
452void
453CPA::swDq(ThreadContext *tc)
454{

--- 10 unchanged lines hidden (view full) ---

465 int sysi = getSys(sys);
466 StackId sid = StackId(sysi, getFrame(tc));
467 if (!smStack[sid].size())
468 return;
469 int smi = smStack[sid].back();
470 int qi = getQ(sysi, q, id);
471 if (swExpl[sid])
472 swExpl[sid] = false;
447 "swQ: %s[%#x] cur size %d %d bytes: %d adding: %d\n",
448 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
449 doQ(sys, FL_NONE, tc->contextId(), smi, q, qi, count);
450}
451
452void
453CPA::swDq(ThreadContext *tc)
454{

--- 10 unchanged lines hidden (view full) ---

465 int sysi = getSys(sys);
466 StackId sid = StackId(sysi, getFrame(tc));
467 if (!smStack[sid].size())
468 return;
469 int smi = smStack[sid].back();
470 int qi = getQ(sysi, q, id);
471 if (swExpl[sid])
472 swExpl[sid] = false;
473 DPRINTFS(AnnotateQ, sys,
473 DPRINTFS(AnnotateQ, sys,
474 "swDq: %s[%#x] cur size %d %d bytes: %d removing: %d\n",
475 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
476 assert(count != 0);
477
478 doDq(sys, FL_NONE, tc->contextId(), smi, q, qi, count);
479}
480
481void

--- 12 unchanged lines hidden (view full) ---

494 int sysi = getSys(sys);
495 StackId sid = StackId(sysi, getFrame(tc));
496 if (!smStack[sid].size())
497 return;
498 int smi = smStack[sid].back();
499 int qi = getQ(sysi, q, id);
500 if (swExpl[sid])
501 swExpl[sid] = false;
474 "swDq: %s[%#x] cur size %d %d bytes: %d removing: %d\n",
475 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
476 assert(count != 0);
477
478 doDq(sys, FL_NONE, tc->contextId(), smi, q, qi, count);
479}
480
481void

--- 12 unchanged lines hidden (view full) ---

494 int sysi = getSys(sys);
495 StackId sid = StackId(sysi, getFrame(tc));
496 if (!smStack[sid].size())
497 return;
498 int smi = smStack[sid].back();
499 int qi = getQ(sysi, q, id);
500 if (swExpl[sid])
501 swExpl[sid] = false;
502 DPRINTFS(AnnotateQ, sys,
502 DPRINTFS(AnnotateQ, sys,
503 "swPq: %s [%#x] cur size %d %d bytes: %d peeking: %d\n",
504 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
505
506 assert(count != 0);
507 if (qBytes[qi-1] < count) {
508 dump(true);
509 dumpKey();
510 fatal("Queue %s peeking with not enough bytes available in queue!\n", q);

--- 18 unchanged lines hidden (view full) ---

529 int sysi = getSys(sys);
530 StackId sid = StackId(sysi, getFrame(tc));
531 if (!smStack[sid].size())
532 return;
533 int smi = smStack[sid].back();
534 int qi = getQ(sysi, q, id);
535 if (swExpl[sid])
536 swExpl[sid] = false;
503 "swPq: %s [%#x] cur size %d %d bytes: %d peeking: %d\n",
504 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
505
506 assert(count != 0);
507 if (qBytes[qi-1] < count) {
508 dump(true);
509 dumpKey();
510 fatal("Queue %s peeking with not enough bytes available in queue!\n", q);

--- 18 unchanged lines hidden (view full) ---

529 int sysi = getSys(sys);
530 StackId sid = StackId(sysi, getFrame(tc));
531 if (!smStack[sid].size())
532 return;
533 int smi = smStack[sid].back();
534 int qi = getQ(sysi, q, id);
535 if (swExpl[sid])
536 swExpl[sid] = false;
537 DPRINTFS(AnnotateQ, sys,
537 DPRINTFS(AnnotateQ, sys,
538 "swRq: %s [%#x] cur size %d %d bytes: %d reserve: %d\n",
539 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
540
541 assert(count != 0);
542
543 add(OP_RESERVE, FL_NONE, tc->contextId(), smi, qi, count);
544}
545

--- 145 unchanged lines hidden (view full) ---

691 std::list<AnnDataPtr>::iterator ai = qData[qi-1].begin();
692 int x = 0;
693 while (ai != qData[qi-1].end()) {
694 DPRINTF(AnnotateQ, "--Element %d size %d\n", x, (*ai)->data);
695 ai++;
696 x++;
697 }
698
538 "swRq: %s [%#x] cur size %d %d bytes: %d reserve: %d\n",
539 q, id, qSize[qi-1], qData[qi-1].size(), qBytes[qi-1], count);
540
541 assert(count != 0);
542
543 add(OP_RESERVE, FL_NONE, tc->contextId(), smi, qi, count);
544}
545

--- 145 unchanged lines hidden (view full) ---

691 std::list<AnnDataPtr>::iterator ai = qData[qi-1].begin();
692 int x = 0;
693 while (ai != qData[qi-1].end()) {
694 DPRINTF(AnnotateQ, "--Element %d size %d\n", x, (*ai)->data);
695 ai++;
696 x++;
697 }
698
699 warn("%d: Queue Assert: SW said there should be %d byte(s) in %s,"
699 warn("%d: Queue Assert: SW said there should be %d byte(s) in %s,"
700 "however there are %d byte(s)\n",
701 curTick(), size, q, qBytes[qi-1]);
702 DPRINTF(AnnotateQ, "%d: Queue Assert: SW said there should be %d"
703 " byte(s) in %s, however there are %d byte(s)\n",
704 curTick(), size, q, qBytes[qi-1]);
705 }
706}
707

--- 92 unchanged lines hidden (view full) ---

800 return;
801
802 int smi = smStack[sid].back();
803
804 DPRINTF(Annotate, "Linking from %d to state machine %s(UNKNOWN)\n",
805 smi, lsm);
806
807 if (scLinks[sysi-1][id])
700 "however there are %d byte(s)\n",
701 curTick(), size, q, qBytes[qi-1]);
702 DPRINTF(AnnotateQ, "%d: Queue Assert: SW said there should be %d"
703 " byte(s) in %s, however there are %d byte(s)\n",
704 curTick(), size, q, qBytes[qi-1]);
705 }
706}
707

--- 92 unchanged lines hidden (view full) ---

800 return;
801
802 int smi = smStack[sid].back();
803
804 DPRINTF(Annotate, "Linking from %d to state machine %s(UNKNOWN)\n",
805 smi, lsm);
806
807 if (scLinks[sysi-1][id])
808 DPRINTF(Annotate,
808 DPRINTF(Annotate,
809 "scLinks already contains entry for system %d %s[%x] of %d\n",
810 sysi, lsm, getFrame(tc), scLinks[sysi-1][id]);
811 assert(scLinks[sysi-1][id] == 0);
812 scLinks[sysi-1][id] = add(OP_LINK, FL_NONE, tc->contextId(), smi, 0xFFFF);
813 scLinks[sysi-1][id]->dump = false;
814
815 if (!!args[1]) {
816 char sm[50];

--- 15 unchanged lines hidden (view full) ---

832 an->stq = stq;
833 an->cpu = c;
834 an->dump = true;
835
836 data.push_back(an);
837
838 DPRINTF(AnnotateVerbose, "Annotate: op: %d flags: 0x%x sm: %d state: %d time: %d, data: %d\n",
839 an->op, an->flag, an->sm, an->stq, an->time, an->data);
809 "scLinks already contains entry for system %d %s[%x] of %d\n",
810 sysi, lsm, getFrame(tc), scLinks[sysi-1][id]);
811 assert(scLinks[sysi-1][id] == 0);
812 scLinks[sysi-1][id] = add(OP_LINK, FL_NONE, tc->contextId(), smi, 0xFFFF);
813 scLinks[sysi-1][id]->dump = false;
814
815 if (!!args[1]) {
816 char sm[50];

--- 15 unchanged lines hidden (view full) ---

832 an->stq = stq;
833 an->cpu = c;
834 an->dump = true;
835
836 data.push_back(an);
837
838 DPRINTF(AnnotateVerbose, "Annotate: op: %d flags: 0x%x sm: %d state: %d time: %d, data: %d\n",
839 an->op, an->flag, an->sm, an->stq, an->time, an->data);
840
840
841 // Don't dump Links because we might be setting no-dump on it
842 if (an->op != OP_LINK)
843 dump(false);
844
845 return an;
846}
847
848void

--- 562 unchanged lines hidden ---
841 // Don't dump Links because we might be setting no-dump on it
842 if (an->op != OP_LINK)
843 dump(false);
844
845 return an;
846}
847
848void

--- 562 unchanged lines hidden ---