.desc("Number of outstanding Icache misses that were squashed")
.prereq(fetchIcacheSquashes);
+ fetchTlbSquashes
+ .name(name() + ".ItlbSquashes")
+ .desc("Number of outstanding ITLB misses that were squashed")
+ .prereq(fetchTlbSquashes);
+
fetchNisnDist
.init(/* base value */ 0,
/* last value */ fetchWidth,
// Align the fetch address so it's at the start of a cache block.
Addr block_PC = icacheBlockAlignPC(vaddr);
+ DPRINTF(Fetch, "[tid:%i] Fetching cache line %#x for addr %#x\n",
+ tid, block_PC, vaddr);
+
// Setup the memReq to do a read of the first instruction's address.
// Set the appropriate read size and flags as well.
// Build request here.
// Wake up CPU if it was idle
cpu->wakeCPU();
+ if (fetchStatus[tid] != ItlbWait || mem_req != memReq[tid] ||
+ mem_req->getVaddr() != memReq[tid]->getVaddr() || isSwitchedOut()) {
+ DPRINTF(Fetch, "[tid:%i] Ignoring itlb completed after squash\n",
+ tid);
+ ++fetchTlbSquashes;
+ delete mem_req;
+ return;
+ }
+
+
// If translation was successful, attempt to read the icache block.
if (fault == NoFault) {
// Build packet here.
fetchStatus[tid] = IcacheWaitResponse;
}
} else {
+ DPRINTF(Fetch, "[tid:%i] Got back req with addr %#x but expected %#x\n",
+ mem_req->getVaddr(), memReq[tid]->getVaddr());
// Translation faulted, icache request won't be sent.
delete mem_req;
memReq[tid] = NULL;
// wake up is if a squash comes along and changes the PC.
TheISA::PCState fetchPC = pc[tid];
+ DPRINTF(Fetch, "[tid:%i]: Translation faulted, building noop.\n", tid);
// We will use a nop in ordier to carry the fault.
DynInstPtr instruction = buildInst(tid,
StaticInstPtr(TheISA::NoopMachInst, fetchPC.instAddr()),
DPRINTF(Fetch, "[tid:%i]: Squashing outstanding Icache miss.\n",
tid);
memReq[tid] = NULL;
+ } else if (fetchStatus[tid] == ItlbWait) {
+ DPRINTF(Fetch, "[tid:%i]: Squashing outstanding ITLB miss.\n",
+ tid);
+ memReq[tid] = NULL;
}
// Get rid of the retrying packet if it was from this thread.
DPRINTF(Fetch, "[tid:%i]: Fetch is waiting ITLB walk to "
"finish! \n", tid);
++fetchTlbCycles;
+ } else if (fetchStatus[tid] == TrapPending) {
+ DPRINTF(Fetch, "[tid:%i]: Fetch is waiting for a pending trap\n",
+ tid);
}
+
// Status is Idle, Squashing, Blocked, ItlbWait or IcacheWaitResponse
// so fetch should do nothing.
return;