exetrace.cc (3970:d54945bab95d) exetrace.cc (3972:2c65c89843c5)
1/*
2 * Copyright (c) 2001-2005 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;

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

54#include "arch/isa_specific.hh"
55#include "cpu/m5legion_interface.h"
56
57using namespace std;
58using namespace TheISA;
59
60#if THE_ISA == SPARC_ISA && FULL_SYSTEM
61static int diffcount = 0;
1/*
2 * Copyright (c) 2001-2005 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;

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

54#include "arch/isa_specific.hh"
55#include "cpu/m5legion_interface.h"
56
57using namespace std;
58using namespace TheISA;
59
60#if THE_ISA == SPARC_ISA && FULL_SYSTEM
61static int diffcount = 0;
62static bool wasMicro = false;
62#endif
63
64namespace Trace {
65SharedData *shared_data = NULL;
66}
67
68////////////////////////////////////////////////////////////////////////
69//

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

119 ccprintf(os, "====================================================================\n");
120}
121
122#endif
123
124void
125Trace::InstRecord::dump(ostream &outs)
126{
63#endif
64
65namespace Trace {
66SharedData *shared_data = NULL;
67}
68
69////////////////////////////////////////////////////////////////////////
70//

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

120 ccprintf(os, "====================================================================\n");
121}
122
123#endif
124
125void
126Trace::InstRecord::dump(ostream &outs)
127{
128 DPRINTF(Sparc, "Instruction: %#X\n", staticInst->machInst);
127 if (flags[PRINT_REG_DELTA])
128 {
129#if THE_ISA == SPARC_ISA
130 //Don't print what happens for each micro-op, just print out
131 //once at the last op, and for regular instructions.
132 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp())
133 {
134 static uint64_t regs[32] = {

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

312 bool diffCwp = false;
313 bool diffCansave = false;
314 bool diffCanrestore = false;
315 bool diffOtherwin = false;
316 bool diffCleanwin = false;
317 bool diffTlb = false;
318 Addr m5Pc, lgnPc;
319
129 if (flags[PRINT_REG_DELTA])
130 {
131#if THE_ISA == SPARC_ISA
132 //Don't print what happens for each micro-op, just print out
133 //once at the last op, and for regular instructions.
134 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp())
135 {
136 static uint64_t regs[32] = {

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

314 bool diffCwp = false;
315 bool diffCansave = false;
316 bool diffCanrestore = false;
317 bool diffOtherwin = false;
318 bool diffCleanwin = false;
319 bool diffTlb = false;
320 Addr m5Pc, lgnPc;
321
322 // We took a trap on a micro-op...
323 if (wasMicro && !staticInst->isMicroOp())
324 {
325 // let's skip comparing this cycle
326 while (!compared)
327 if (shared_data->flags == OWN_M5) {
328 shared_data->flags = OWN_LEGION;
329 compared = true;
330 }
331 compared = false;
332 wasMicro = false;
333 }
320
334
335 if (staticInst->isLastMicroOp())
336 wasMicro = false;
337 else if (staticInst->isMicroOp())
338 wasMicro = true;
339
340
321 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp()) {
322 while (!compared) {
323 if (shared_data->flags == OWN_M5) {
324 m5Pc = PC & TheISA::PAddrImplMask;
325 lgnPc = shared_data->pc & TheISA::PAddrImplMask;
326 if (lgnPc != m5Pc)
327 diffPC = true;
328

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

602 outs << " X ";
603 else
604 outs << " | ";
605 outs << "0x" << setw(16) << hex
606 << shared_data->intregs[y*8+x]
607 << endl;*/
608 }
609 }
341 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp()) {
342 while (!compared) {
343 if (shared_data->flags == OWN_M5) {
344 m5Pc = PC & TheISA::PAddrImplMask;
345 lgnPc = shared_data->pc & TheISA::PAddrImplMask;
346 if (lgnPc != m5Pc)
347 diffPC = true;
348

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

622 outs << " X ";
623 else
624 outs << " | ";
625 outs << "0x" << setw(16) << hex
626 << shared_data->intregs[y*8+x]
627 << endl;*/
628 }
629 }
610 printColumnLabels(outs);
611 char label[8];
612 for (int x = 0; x < 64; x++) {
613 if (shared_data->itb[x] != ULL(0xFFFFFFFFFFFFFFFF) ||
614 thread->getITBPtr()->TteRead(x) != ULL(0xFFFFFFFFFFFFFFFF)) {
615 sprintf(label, "I-TLB:%02d", x);
616 printRegPair(outs, label, thread->getITBPtr()->TteRead(x), shared_data->itb[x]);
630 if (diffTlb) {
631 printColumnLabels(outs);
632 char label[8];
633 for (int x = 0; x < 64; x++) {
634 if (shared_data->itb[x] != ULL(0xFFFFFFFFFFFFFFFF) ||
635 thread->getITBPtr()->TteRead(x) != ULL(0xFFFFFFFFFFFFFFFF)) {
636 sprintf(label, "I-TLB:%02d", x);
637 printRegPair(outs, label, thread->getITBPtr()->TteRead(x),
638 shared_data->itb[x]);
639 }
617 }
640 }
618 }
619 for (int x = 0; x < 64; x++) {
620 if (shared_data->dtb[x] != ULL(0xFFFFFFFFFFFFFFFF) ||
621 thread->getDTBPtr()->TteRead(x) != ULL(0xFFFFFFFFFFFFFFFF)) {
622 sprintf(label, "D-TLB:%02d", x);
623 printRegPair(outs, label, thread->getDTBPtr()->TteRead(x), shared_data->dtb[x]);
641 for (int x = 0; x < 64; x++) {
642 if (shared_data->dtb[x] != ULL(0xFFFFFFFFFFFFFFFF) ||
643 thread->getDTBPtr()->TteRead(x) != ULL(0xFFFFFFFFFFFFFFFF)) {
644 sprintf(label, "D-TLB:%02d", x);
645 printRegPair(outs, label, thread->getDTBPtr()->TteRead(x),
646 shared_data->dtb[x]);
647 }
624 }
648 }
649 thread->getITBPtr()->dumpAll();
650 thread->getDTBPtr()->dumpAll();
625 }
651 }
626 thread->getITBPtr()->dumpAll();
627 thread->getDTBPtr()->dumpAll();
628
629 diffcount++;
630 if (diffcount > 2)
631 fatal("Differences found between Legion and M5\n");
652
653 diffcount++;
654 if (diffcount > 2)
655 fatal("Differences found between Legion and M5\n");
632 }
656 } else
657 diffcount = 0;
633
634 compared = true;
635 shared_data->flags = OWN_LEGION;
636 }
637 } // while
638 } // if not microop
639 }
640#endif

--- 109 unchanged lines hidden ---
658
659 compared = true;
660 shared_data->flags = OWN_LEGION;
661 }
662 } // while
663 } // if not microop
664 }
665#endif

--- 109 unchanged lines hidden ---