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;
--- 127 unchanged lines hidden (view full) ---
136 static uint64_t y = 0;
137 static uint64_t floats[32];
138 uint64_t newVal;
139 static const char * prefixes[4] = {"G", "O", "L", "I"};
140
141 outs << hex;
142 outs << "PC = " << thread->readNextPC();
143 outs << " NPC = " << thread->readNextNPC();
144 newVal = thread->readIntReg(SparcISA::NumIntArchRegs + 2);
145 //newVal = thread->readMiscReg(SparcISA::MISCREG_CCR);
146 if(newVal != ccr)
147 {
148 outs << " CCR = " << newVal;
149 ccr = newVal;
150 }
151 newVal = thread->readIntReg(SparcISA::NumIntArchRegs + 1);
152 //newVal = thread->readMiscReg(SparcISA::MISCREG_Y);
153 if(newVal != y)
154 {
155 outs << " Y = " << newVal;
156 y = newVal;
157 }
158 for(int y = 0; y < 4; y++)
159 {
160 for(int x = 0; x < 8; x++)
--- 121 unchanged lines hidden (view full) ---
282 outs << endl;
283 }
284#if THE_ISA == SPARC_ISA
285 // Compare
286 if (flags[LEGION_LOCKSTEP])
287 {
288 bool compared = false;
289 bool diffPC = false;
290 bool diffInst = false;
291 bool diffRegs = false;
292 bool diffTpc = false;
293 bool diffTnpc = false;
294 bool diffTstate = false;
295 bool diffTt = false;
296 bool diffTba = false;
297 bool diffHpstate = false;
--- 16 unchanged lines hidden (view full) ---
314
315 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp()) {
316 while (!compared) {
317 if (shared_data->flags == OWN_M5) {
318 m5Pc = PC & TheISA::PAddrImplMask;
319 lgnPc = shared_data->pc & TheISA::PAddrImplMask;
320 if (lgnPc != m5Pc)
321 diffPC = true;
322 if (shared_data->instruction !=
323 (SparcISA::MachInst)staticInst->machInst) {
324 diffInst = true;
325 }
326 for (int i = 0; i < TheISA::NumIntArchRegs; i++) {
327 if (thread->readIntReg(i) != shared_data->intregs[i]) {
328 diffRegs = true;
329 }
--- 30 unchanged lines hidden (view full) ---
360 //we just don't compare it. It's not supposed to matter
361 //anyway.
362 if((shared_data->hpstate | (1 << 11)) != thread->readMiscReg(MISCREG_HPSTATE))
363 diffHpstate = true;
364 if(shared_data->htba != thread->readMiscReg(MISCREG_HTBA))
365 diffHtba = true;
366 if(shared_data->pstate != thread->readMiscReg(MISCREG_PSTATE))
367 diffPstate = true;
368 //if(shared_data->y != thread->readMiscReg(MISCREG_Y))
369 if(shared_data->y !=
370 thread->readIntReg(NumIntArchRegs + 1))
371 diffY = true;
372 //if(shared_data->ccr != thread->readMiscReg(MISCREG_CCR))
373 if(shared_data->ccr !=
374 thread->readIntReg(NumIntArchRegs + 2))
375 diffCcr = true;
376 if(shared_data->gl != thread->readMiscReg(MISCREG_GL))
377 diffGl = true;
378 if(shared_data->asi != thread->readMiscReg(MISCREG_ASI))
379 diffAsi = true;
380 if(shared_data->pil != thread->readMiscReg(MISCREG_PIL))
381 diffPil = true;
382 if(shared_data->cwp != thread->readMiscReg(MISCREG_CWP))
383 diffCwp = true;
384 //if(shared_data->cansave != thread->readMiscReg(MISCREG_CANSAVE))
385 if(shared_data->cansave !=
386 thread->readIntReg(NumIntArchRegs + 3))
387 diffCansave = true;
388 //if(shared_data->canrestore !=
389 // thread->readMiscReg(MISCREG_CANRESTORE))
390 if(shared_data->canrestore !=
391 thread->readMiscReg(NumIntArchRegs + 4))
392 diffCanrestore = true;
393 //if(shared_data->otherwin != thread->readMiscReg(MISCREG_OTHERWIN))
394 if(shared_data->otherwin !=
395 thread->readIntReg(NumIntArchRegs + 5))
396 diffOtherwin = true;
397 //if(shared_data->cleanwin != thread->readMiscReg(MISCREG_CLEANWIN))
398 if(shared_data->cleanwin !=
399 thread->readMiscReg(NumIntArchRegs + 6))
400 diffCleanwin = true;
401
402 if (diffPC || diffInst || diffRegs || diffTpc || diffTnpc ||
403 diffTstate || diffTt || diffHpstate ||
404 diffHtstate || diffHtba || diffPstate || diffY ||
405 diffCcr || diffTl || diffGl || diffAsi || diffPil ||
406 diffCwp || diffCansave || diffCanrestore ||
407 diffOtherwin || diffCleanwin) {
408 outs << "Differences found between M5 and Legion:";
409 if (diffPC)
410 outs << " [PC]";
411 if (diffInst)
412 outs << " [Instruction]";
413 if (diffRegs)
414 outs << " [IntRegs]";
415 if (diffTpc)
416 outs << " [Tpc]";
417 if (diffTnpc)
418 outs << " [Tnpc]";
--- 35 unchanged lines hidden (view full) ---
454
455 outs << right << setfill(' ') << setw(15)
456 << "M5 PC: " << "0x"<< setw(16) << setfill('0')
457 << hex << m5Pc << endl;
458 outs << setfill(' ') << setw(15)
459 << "Legion PC: " << "0x"<< setw(16) << setfill('0') << hex
460 << lgnPc << endl << endl;
461
462 outs << setfill(' ') << setw(15)
463 << "M5 Inst: " << "0x"<< setw(8)
464 << setfill('0') << hex << staticInst->machInst
465 << staticInst->disassemble(m5Pc, debugSymbolTable)
466 << endl;
467
468 StaticInstPtr legionInst =
469 StaticInst::decode(makeExtMI(shared_data->instruction,
470 thread));
--- 11 unchanged lines hidden (view full) ---
482 shared_data->hpstate | (1 << 11));
483 printRegPair(outs, "Htba",
484 thread->readMiscReg(MISCREG_HTBA),
485 shared_data->htba);
486 printRegPair(outs, "Pstate",
487 thread->readMiscReg(MISCREG_PSTATE),
488 shared_data->pstate);
489 printRegPair(outs, "Y",
490 //thread->readMiscReg(MISCREG_Y),
491 thread->readMiscReg(NumIntArchRegs + 1),
492 shared_data->y);
493 printRegPair(outs, "Ccr",
494 //thread->readMiscReg(MISCREG_CCR),
495 thread->readMiscReg(NumIntArchRegs + 2),
496 shared_data->ccr);
497 printRegPair(outs, "Tl",
498 thread->readMiscReg(MISCREG_TL),
499 shared_data->tl);
500 printRegPair(outs, "Gl",
501 thread->readMiscReg(MISCREG_GL),
502 shared_data->gl);
503 printRegPair(outs, "Asi",
504 thread->readMiscReg(MISCREG_ASI),
505 shared_data->asi);
506 printRegPair(outs, "Pil",
507 thread->readMiscReg(MISCREG_PIL),
508 shared_data->pil);
509 printRegPair(outs, "Cwp",
510 thread->readMiscReg(MISCREG_CWP),
511 shared_data->cwp);
512 printRegPair(outs, "Cansave",
513 //thread->readMiscReg(MISCREG_CANSAVE),
514 thread->readIntReg(NumIntArchRegs + 3),
515 shared_data->cansave);
516 printRegPair(outs, "Canrestore",
517 //thread->readMiscReg(MISCREG_CANRESTORE),
518 thread->readIntReg(NumIntArchRegs + 4),
519 shared_data->canrestore);
520 printRegPair(outs, "Otherwin",
521 //thread->readMiscReg(MISCREG_OTHERWIN),
522 thread->readIntReg(NumIntArchRegs + 5),
523 shared_data->otherwin);
524 printRegPair(outs, "Cleanwin",
525 //thread->readMiscReg(MISCREG_CLEANWIN),
526 thread->readIntReg(NumIntArchRegs + 6),
527 shared_data->cleanwin);
528 outs << endl;
529 for (int i = 1; i <= MaxTL; i++) {
530 printLevelHeader(outs, i);
531 printColumnLabels(outs);
532 thread->setMiscReg(MISCREG_TL, i);
533 printRegPair(outs, "Tpc",
534 thread->readMiscReg(MISCREG_TPC),
--- 160 unchanged lines hidden ---
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;
--- 127 unchanged lines hidden (view full) ---
136 static uint64_t y = 0;
137 static uint64_t floats[32];
138 uint64_t newVal;
139 static const char * prefixes[4] = {"G", "O", "L", "I"};
140
141 outs << hex;
142 outs << "PC = " << thread->readNextPC();
143 outs << " NPC = " << thread->readNextNPC();
144 newVal = thread->readIntReg(SparcISA::NumIntArchRegs + 2);
145 //newVal = thread->readMiscReg(SparcISA::MISCREG_CCR);
146 if(newVal != ccr)
147 {
148 outs << " CCR = " << newVal;
149 ccr = newVal;
150 }
151 newVal = thread->readIntReg(SparcISA::NumIntArchRegs + 1);
152 //newVal = thread->readMiscReg(SparcISA::MISCREG_Y);
153 if(newVal != y)
154 {
155 outs << " Y = " << newVal;
156 y = newVal;
157 }
158 for(int y = 0; y < 4; y++)
159 {
160 for(int x = 0; x < 8; x++)
--- 121 unchanged lines hidden (view full) ---
282 outs << endl;
283 }
284#if THE_ISA == SPARC_ISA
285 // Compare
286 if (flags[LEGION_LOCKSTEP])
287 {
288 bool compared = false;
289 bool diffPC = false;
290 bool diffInst = false;
291 bool diffRegs = false;
292 bool diffTpc = false;
293 bool diffTnpc = false;
294 bool diffTstate = false;
295 bool diffTt = false;
296 bool diffTba = false;
297 bool diffHpstate = false;
--- 16 unchanged lines hidden (view full) ---
314
315 if(!staticInst->isMicroOp() || staticInst->isLastMicroOp()) {
316 while (!compared) {
317 if (shared_data->flags == OWN_M5) {
318 m5Pc = PC & TheISA::PAddrImplMask;
319 lgnPc = shared_data->pc & TheISA::PAddrImplMask;
320 if (lgnPc != m5Pc)
321 diffPC = true;
322 if (shared_data->instruction !=
323 (SparcISA::MachInst)staticInst->machInst) {
324 diffInst = true;
325 }
326 for (int i = 0; i < TheISA::NumIntArchRegs; i++) {
327 if (thread->readIntReg(i) != shared_data->intregs[i]) {
328 diffRegs = true;
329 }
--- 30 unchanged lines hidden (view full) ---
360 //we just don't compare it. It's not supposed to matter
361 //anyway.
362 if((shared_data->hpstate | (1 << 11)) != thread->readMiscReg(MISCREG_HPSTATE))
363 diffHpstate = true;
364 if(shared_data->htba != thread->readMiscReg(MISCREG_HTBA))
365 diffHtba = true;
366 if(shared_data->pstate != thread->readMiscReg(MISCREG_PSTATE))
367 diffPstate = true;
368 //if(shared_data->y != thread->readMiscReg(MISCREG_Y))
369 if(shared_data->y !=
370 thread->readIntReg(NumIntArchRegs + 1))
371 diffY = true;
372 //if(shared_data->ccr != thread->readMiscReg(MISCREG_CCR))
373 if(shared_data->ccr !=
374 thread->readIntReg(NumIntArchRegs + 2))
375 diffCcr = true;
376 if(shared_data->gl != thread->readMiscReg(MISCREG_GL))
377 diffGl = true;
378 if(shared_data->asi != thread->readMiscReg(MISCREG_ASI))
379 diffAsi = true;
380 if(shared_data->pil != thread->readMiscReg(MISCREG_PIL))
381 diffPil = true;
382 if(shared_data->cwp != thread->readMiscReg(MISCREG_CWP))
383 diffCwp = true;
384 //if(shared_data->cansave != thread->readMiscReg(MISCREG_CANSAVE))
385 if(shared_data->cansave !=
386 thread->readIntReg(NumIntArchRegs + 3))
387 diffCansave = true;
388 //if(shared_data->canrestore !=
389 // thread->readMiscReg(MISCREG_CANRESTORE))
390 if(shared_data->canrestore !=
391 thread->readMiscReg(NumIntArchRegs + 4))
392 diffCanrestore = true;
393 //if(shared_data->otherwin != thread->readMiscReg(MISCREG_OTHERWIN))
394 if(shared_data->otherwin !=
395 thread->readIntReg(NumIntArchRegs + 5))
396 diffOtherwin = true;
397 //if(shared_data->cleanwin != thread->readMiscReg(MISCREG_CLEANWIN))
398 if(shared_data->cleanwin !=
399 thread->readMiscReg(NumIntArchRegs + 6))
400 diffCleanwin = true;
401
402 if (diffPC || diffInst || diffRegs || diffTpc || diffTnpc ||
403 diffTstate || diffTt || diffHpstate ||
404 diffHtstate || diffHtba || diffPstate || diffY ||
405 diffCcr || diffTl || diffGl || diffAsi || diffPil ||
406 diffCwp || diffCansave || diffCanrestore ||
407 diffOtherwin || diffCleanwin) {
408 outs << "Differences found between M5 and Legion:";
409 if (diffPC)
410 outs << " [PC]";
411 if (diffInst)
412 outs << " [Instruction]";
413 if (diffRegs)
414 outs << " [IntRegs]";
415 if (diffTpc)
416 outs << " [Tpc]";
417 if (diffTnpc)
418 outs << " [Tnpc]";
--- 35 unchanged lines hidden (view full) ---
454
455 outs << right << setfill(' ') << setw(15)
456 << "M5 PC: " << "0x"<< setw(16) << setfill('0')
457 << hex << m5Pc << endl;
458 outs << setfill(' ') << setw(15)
459 << "Legion PC: " << "0x"<< setw(16) << setfill('0') << hex
460 << lgnPc << endl << endl;
461
462 outs << setfill(' ') << setw(15)
463 << "M5 Inst: " << "0x"<< setw(8)
464 << setfill('0') << hex << staticInst->machInst
465 << staticInst->disassemble(m5Pc, debugSymbolTable)
466 << endl;
467
468 StaticInstPtr legionInst =
469 StaticInst::decode(makeExtMI(shared_data->instruction,
470 thread));
--- 11 unchanged lines hidden (view full) ---
482 shared_data->hpstate | (1 << 11));
483 printRegPair(outs, "Htba",
484 thread->readMiscReg(MISCREG_HTBA),
485 shared_data->htba);
486 printRegPair(outs, "Pstate",
487 thread->readMiscReg(MISCREG_PSTATE),
488 shared_data->pstate);
489 printRegPair(outs, "Y",
490 //thread->readMiscReg(MISCREG_Y),
491 thread->readMiscReg(NumIntArchRegs + 1),
492 shared_data->y);
493 printRegPair(outs, "Ccr",
494 //thread->readMiscReg(MISCREG_CCR),
495 thread->readMiscReg(NumIntArchRegs + 2),
496 shared_data->ccr);
497 printRegPair(outs, "Tl",
498 thread->readMiscReg(MISCREG_TL),
499 shared_data->tl);
500 printRegPair(outs, "Gl",
501 thread->readMiscReg(MISCREG_GL),
502 shared_data->gl);
503 printRegPair(outs, "Asi",
504 thread->readMiscReg(MISCREG_ASI),
505 shared_data->asi);
506 printRegPair(outs, "Pil",
507 thread->readMiscReg(MISCREG_PIL),
508 shared_data->pil);
509 printRegPair(outs, "Cwp",
510 thread->readMiscReg(MISCREG_CWP),
511 shared_data->cwp);
512 printRegPair(outs, "Cansave",
513 //thread->readMiscReg(MISCREG_CANSAVE),
514 thread->readIntReg(NumIntArchRegs + 3),
515 shared_data->cansave);
516 printRegPair(outs, "Canrestore",
517 //thread->readMiscReg(MISCREG_CANRESTORE),
518 thread->readIntReg(NumIntArchRegs + 4),
519 shared_data->canrestore);
520 printRegPair(outs, "Otherwin",
521 //thread->readMiscReg(MISCREG_OTHERWIN),
522 thread->readIntReg(NumIntArchRegs + 5),
523 shared_data->otherwin);
524 printRegPair(outs, "Cleanwin",
525 //thread->readMiscReg(MISCREG_CLEANWIN),
526 thread->readIntReg(NumIntArchRegs + 6),
527 shared_data->cleanwin);
528 outs << endl;
529 for (int i = 1; i <= MaxTL; i++) {
530 printLevelHeader(outs, i);
531 printColumnLabels(outs);
532 thread->setMiscReg(MISCREG_TL, i);
533 printRegPair(outs, "Tpc",
534 thread->readMiscReg(MISCREG_TPC),
--- 160 unchanged lines hidden ---