class AddressErrorFault : public MipsFault<AddressErrorFault>
{
public:
+ AddressErrorFault(Addr vaddr) { badVAddr = vaddr; }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class StoreAddressErrorFault : public MipsFault<StoreAddressErrorFault>
{
public:
+ StoreAddressErrorFault(Addr vaddr) { badVAddr = vaddr; }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class ItbRefillFault : public MipsFault<ItbRefillFault>
{
public:
+ ItbRefillFault(Addr asid, Addr vaddr, Addr vpn)
+ {
+ entryHiAsid = asid;
+ entryHiVPN2 = vpn >> 2;
+ entryHiVPN2X = vpn & 0x3;
+ badVAddr = vaddr;
+ contextBadVPN2 = vpn >> 2;
+ }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class DtbRefillFault : public MipsFault<DtbRefillFault>
{
public:
+ DtbRefillFault(Addr asid, Addr vaddr, Addr vpn)
+ {
+ entryHiAsid = asid;
+ entryHiVPN2 = vpn >> 2;
+ entryHiVPN2X = vpn & 0x3;
+ badVAddr = vaddr;
+ contextBadVPN2 = vpn >> 2;
+ }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class ItbInvalidFault : public MipsFault<ItbInvalidFault>
{
public:
+ ItbInvalidFault(Addr asid, Addr vaddr, Addr vpn)
+ {
+ entryHiAsid = asid;
+ entryHiVPN2 = vpn >> 2;
+ entryHiVPN2X = vpn & 0x3;
+ badVAddr = vaddr;
+ contextBadVPN2 = vpn >> 2;
+ }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class TLBModifiedFault : public MipsFault<TLBModifiedFault>
{
public:
+ TLBModifiedFault(Addr asid, Addr vaddr, Addr vpn)
+ {
+ entryHiAsid = asid;
+ entryHiVPN2 = vpn >> 2;
+ entryHiVPN2X = vpn & 0x3;
+ badVAddr = vaddr;
+ contextBadVPN2 = vpn >> 2;
+ }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
class DtbInvalidFault : public MipsFault<DtbInvalidFault>
{
public:
+ DtbInvalidFault(Addr asid, Addr vaddr, Addr vpn)
+ {
+ entryHiAsid = asid;
+ entryHiVPN2 = vpn >> 2;
+ entryHiVPN2X = vpn & 0x3;
+ badVAddr = vaddr;
+ contextBadVPN2 = vpn >> 2;
+ }
#if FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInst::StaticInstPtr inst = nullStaticInstPtr);
req->setPaddr(KSeg02Phys(vaddr));
if (getOperatingMode(tc->readMiscReg(MISCREG_STATUS)) != mode_kernel ||
misaligned) {
- AddressErrorFault *Flt = new AddressErrorFault();
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
- return Flt;
+ return new AddressErrorFault(vaddr);
}
} else if(IsKSeg1(vaddr)) {
// Address will not be translated through TLB, set response, and go!
uint8_t Asid = req->getAsid();
if (misaligned) {
// Unaligned address!
- AddressErrorFault *Flt = new AddressErrorFault();
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
- return Flt;
+ return new AddressErrorFault(vaddr);
}
PTE *pte = lookup(VPN,Asid);
if (pte != NULL) {
}
if (Valid == false) {
- //Invalid entry
- ItbInvalidFault *Flt = new ItbInvalidFault();
- /* EntryHi VPN, ASID fields must be set */
- Flt->entryHiAsid = Asid;
- Flt->entryHiVPN2 = (VPN >> 2);
- Flt->entryHiVPN2X = (VPN & 0x3);
-
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- /* Context must be set */
- Flt->contextBadVPN2 = (VPN >> 2);
- return Flt;
+ return new ItbInvalidFault(Asid, vaddr, vpn);
} else {
// Ok, this is really a match, set paddr
Addr PAddr;
}
} else {
// Didn't find any match, return a TLB Refill Exception
- ItbRefillFault *Flt = new ItbRefillFault();
- /* EntryHi VPN, ASID fields must be set */
- Flt->entryHiAsid = Asid;
- Flt->entryHiVPN2 = (VPN >> 2);
- Flt->entryHiVPN2X = (VPN & 0x3);
-
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- /* Context must be set */
- Flt->contextBadVPN2 = (VPN >> 2);
- return Flt;
+ return new ItbRefillFault(Asid, vaddr, vpn);
}
}
return checkCacheability(req);
req->setPaddr(KSeg02Phys(vaddr));
if (getOperatingMode(tc->readMiscReg(MISCREG_STATUS)) != mode_kernel ||
misaligned) {
- StoreAddressErrorFault *Flt = new StoreAddressErrorFault();
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- return Flt;
+ return new StoreAddressErrorFault(vaddr);
}
} else if(IsKSeg1(vaddr)) {
// Address will not be translated through TLB, set response, and go!
uint8_t Asid = req->getAsid();
PTE *pte = lookup(VPN, Asid);
if (misaligned) {
- // Unaligned address!
- StoreAddressErrorFault *Flt = new StoreAddressErrorFault();
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
- return Flt;
+ return new StoreAddressErrorFault(vaddr);
}
if (pte != NULL) {
// Ok, found something
}
if (Valid == false) {
- //Invalid entry
- DtbInvalidFault *Flt = new DtbInvalidFault();
- /* EntryHi VPN, ASID fields must be set */
- Flt->entryHiAsid = Asid;
- Flt->entryHiVPN2 = (VPN>>2);
- Flt->entryHiVPN2X = (VPN & 0x3);
-
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- /* Context must be set */
- Flt->contextBadVPN2 = (VPN >> 2);
-
- return Flt;
+ return new DtbInvalidFault(Asid, vaddr, VPN);
} else {
// Ok, this is really a match, set paddr
if (!Dirty) {
- TLBModifiedFault *Flt = new TLBModifiedFault();
- /* EntryHi VPN, ASID fields must be set */
- Flt->entryHiAsid = Asid;
- Flt->entryHiVPN2 = (VPN >> 2);
- Flt->entryHiVPN2X = (VPN & 0x3);
-
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- /* Context must be set */
- Flt->contextBadVPN2 = (VPN >> 2);
- return Flt;
+ return new TLBModifiedFault(Asid, vaddr, VPN);
}
Addr PAddr;
if (EvenOdd == 0) {
}
} else {
// Didn't find any match, return a TLB Refill Exception
- DtbRefillFault *Flt = new DtbRefillFault();
- /* EntryHi VPN, ASID fields must be set */
- Flt->entryHiAsid = Asid;
- Flt->entryHiVPN2 = (VPN >> 2);
- Flt->entryHiVPN2X = (VPN & 0x3);
-
- /* BadVAddr must be set */
- Flt->badVAddr = vaddr;
-
- /* Context must be set */
- Flt->contextBadVPN2 = (VPN >> 2);
- return Flt;
+ return new DtbRefillFault(Asid, vaddr, VPN);
}
}
return checkCacheability(req);