33a34
> #include <errno.h>
41a43
> #include "base/socket.hh"
66a69
> ListenSocket *cosim_listener = NULL;
151a155
> bool diff = true;
153a158,159
> diff = false;
> #ifndef NDEBUG
154a161
> static int fd = 0;
158a166,248
> if(!cosim_listener)
> {
> int port = 8000;
> cosim_listener = new ListenSocket();
> while(!cosim_listener->listen(port, true))
> {
> DPRINTF(GDBMisc, "Can't bind port %d\n", port);
> port++;
> }
> ccprintf(cerr, "Listening for cosimulator on port %d\n", port);
> fd = cosim_listener->accept();
> }
> char prefix[] = "goli";
> for(int p = 0; p < 4; p++)
> {
> for(int i = 0; i < 8; i++)
> {
> uint64_t regVal;
> int res = read(fd, &regVal, sizeof(regVal));
> if(res < 0)
> panic("First read call failed! %s\n", strerror(errno));
> regVal = TheISA::gtoh(regVal);
> uint64_t realRegVal = thread->readIntReg(p * 8 + i);
> if((regVal & 0xffffffffULL) != (realRegVal & 0xffffffffULL))
> {
> DPRINTF(ExecRegDelta, "Register %s%d should be %#x but is %#x.\n", prefix[p], i, regVal, realRegVal);
> diff = true;
> }
> //ccprintf(outs, "%s%d m5 = %#x statetrace = %#x\n", prefix[p], i, realRegVal, regVal);
> }
> }
> /*for(int f = 0; f <= 62; f+=2)
> {
> uint64_t regVal;
> int res = read(fd, &regVal, sizeof(regVal));
> if(res < 0)
> panic("First read call failed! %s\n", strerror(errno));
> regVal = TheISA::gtoh(regVal);
> uint64_t realRegVal = thread->readFloatRegBits(f, 64);
> if(regVal != realRegVal)
> {
> DPRINTF(ExecRegDelta, "Register f%d should be %#x but is %#x.\n", f, regVal, realRegVal);
> }
> }*/
> uint64_t regVal;
> int res = read(fd, &regVal, sizeof(regVal));
> if(res < 0)
> panic("First read call failed! %s\n", strerror(errno));
> regVal = TheISA::gtoh(regVal);
> uint64_t realRegVal = thread->readNextPC();
> if(regVal != realRegVal)
> {
> DPRINTF(ExecRegDelta, "Register pc should be %#x but is %#x.\n", regVal, realRegVal);
> diff = true;
> }
> res = read(fd, &regVal, sizeof(regVal));
> if(res < 0)
> panic("First read call failed! %s\n", strerror(errno));
> regVal = TheISA::gtoh(regVal);
> realRegVal = thread->readNextNPC();
> if(regVal != realRegVal)
> {
> DPRINTF(ExecRegDelta, "Register npc should be %#x but is %#x.\n", regVal, realRegVal);
> diff = true;
> }
> res = read(fd, &regVal, sizeof(regVal));
> if(res < 0)
> panic("First read call failed! %s\n", strerror(errno));
> regVal = TheISA::gtoh(regVal);
> realRegVal = thread->readIntReg(SparcISA::NumIntArchRegs + 2);
> if((regVal & 0xF) != (realRegVal & 0xF))
> {
> DPRINTF(ExecRegDelta, "Register ccr should be %#x but is %#x.\n", regVal, realRegVal);
> diff = true;
> }
> }
> #endif
> #endif
> #if 0 //THE_ISA == SPARC_ISA
> //Don't print what happens for each micro-op, just print out
> //once at the last op, and for regular instructions.
> if(!staticInst->isMicroOp() || staticInst->isLastMicroOp())
> {
213c303,304
< else if (IsOn(ExecIntel)) {
---
> if(!diff) {
> } else if (IsOn(ExecIntel)) {