diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2011-07-10 12:56:08 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2011-07-10 12:56:08 -0500 |
commit | 60579e8d74cecea5737a4502599ccf77e9e6a35e (patch) | |
tree | 34e86b09774b7a10ba1948b189d00006d19ed684 /src/cpu/o3/fetch_impl.hh | |
parent | 9751a1d3e78cbbcd17835ab967f036945ee2cec2 (diff) | |
download | gem5-60579e8d74cecea5737a4502599ccf77e9e6a35e.tar.xz |
O3: Make sure fetch doesn't go off into the weeds during speculation.
Diffstat (limited to 'src/cpu/o3/fetch_impl.hh')
-rw-r--r-- | src/cpu/o3/fetch_impl.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 8b1797f11..118f132ca 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -633,6 +633,18 @@ DefaultFetch<Impl>::finishTranslation(Fault fault, RequestPtr mem_req) // If translation was successful, attempt to read the icache block. if (fault == NoFault) { + // Check that we're not going off into random memory + // If we have, just wait around for commit to squash something and put + // us on the right track + if (!cpu->system->isMemory(mem_req->getPaddr())) { + warn("Address %#x is outside of physical memory, stopping fetch\n", + mem_req->getPaddr()); + fetchStatus[tid] = NoGoodAddr; + delete mem_req; + memReq[tid] = NULL; + return; + } + // Build packet here. PacketPtr data_pkt = new Packet(mem_req, MemCmd::ReadReq, Packet::Broadcast); @@ -1162,9 +1174,13 @@ DefaultFetch<Impl>::fetch(bool &status_change) } else if (fetchStatus[tid] == TrapPending) { DPRINTF(Fetch, "[tid:%i]: Fetch is waiting for a pending trap\n", tid); + } else if (fetchStatus[tid] == NoGoodAddr) { + DPRINTF(Fetch, "[tid:%i]: Fetch predicted non-executable address\n", + tid); } + // Status is Idle, Squashing, Blocked, ItlbWait or IcacheWaitResponse // so fetch should do nothing. return; |