diff -r 93c6317af258 src/arch/mips/faults.hh --- a/src/arch/mips/faults.hh Sat Jan 07 07:40:44 2012 -0600 +++ b/src/arch/mips/faults.hh Tue Jan 10 01:02:55 2012 +0800 @@ -87,7 +87,7 @@ virtual FaultVect base(ThreadContext *tc) const { StatusReg status = tc->readMiscReg(MISCREG_STATUS); - if (status.bev) + if (!status.bev) return tc->readMiscReg(MISCREG_EBASE); else return 0xbfc00200; @@ -166,7 +166,7 @@ if (FULL_SYSTEM) { CauseReg cause = tc->readMiscReg(MISCREG_CAUSE); cause.ce = coProcID; - tc->setMiscReg(MISCREG_CAUSE, cause); + tc->setMiscRegNoEffect(MISCREG_CAUSE, cause); } } }; @@ -178,7 +178,8 @@ offset(ThreadContext *tc) const { CauseReg cause = tc->readMiscRegNoEffect(MISCREG_CAUSE); - return cause.iv ? 0x200 : 0x000; + // offset 0x200 for release 2, 0x180 for release 1. + return cause.iv ? 0x200 : 0x180; } }; @@ -250,9 +251,10 @@ StaticInstPtr inst = StaticInst::nullStaticInstPtr) { if (FULL_SYSTEM) { - DPRINTF(MipsPRA, "Fault %s encountered.\n", name()); - tc->pcState(this->vect(tc)); + DPRINTF(MipsPRA, "Fault %s encountered.\n", this->name()); + Addr vect = this->vect(tc); setTlbExceptionState(tc, this->code()); + tc->pcState(vect); } else { AddressFault::invoke(tc, inst); } diff -r 93c6317af258 src/arch/mips/faults.cc --- a/src/arch/mips/faults.cc Sat Jan 07 07:40:44 2012 -0600 +++ b/src/arch/mips/faults.cc Tue Jan 10 01:02:55 2012 +0800 @@ -121,7 +121,7 @@ DPRINTF(MipsPRA, "PC: %s\n", pc); bool delay_slot = pc.pc() + sizeof(MachInst) != pc.npc(); tc->setMiscRegNoEffect(MISCREG_EPC, - pc.pc() - delay_slot ? sizeof(MachInst) : 0); + pc.pc() - (delay_slot ? sizeof(MachInst) : 0)); // Set Cause_EXCCODE field CauseReg cause = tc->readMiscReg(MISCREG_CAUSE); diff -r 93c6317af258 src/arch/mips/tlb.cc --- a/src/arch/mips/tlb.cc Sat Jan 07 07:40:44 2012 -0600 +++ b/src/arch/mips/tlb.cc Tue Jan 10 01:02:55 2012 +0800 @@ -350,7 +350,7 @@ } if (Valid == false) { - return new InvalidFault(Asid, vaddr, vpn, false); + return new TlbInvalidFault(Asid, vaddr, VPN, false); } else { // Ok, this is really a match, set paddr Addr PAddr; @@ -366,7 +366,7 @@ } } else { // Didn't find any match, return a TLB Refill Exception - return new RefillFault(Asid, vaddr, vpn, false); + return new TlbRefillFault(Asid, vaddr, VPN, false); } } return checkCacheability(req); @@ -445,10 +445,10 @@ } if (Valid == false) { - return new InvalidFault(Asid, vaddr, VPN, true); + return new TlbInvalidFault(Asid, vaddr, VPN, write); } else { // Ok, this is really a match, set paddr - if (!Dirty) { + if (!Dirty && write) { return new TlbModifiedFault(Asid, vaddr, VPN); } Addr PAddr; @@ -464,7 +464,7 @@ } } else { // Didn't find any match, return a TLB Refill Exception - return new RefillFault(Asid, vaddr, VPN, true); + return new TlbRefillFault(Asid, vaddr, VPN, write); } } return checkCacheability(req);