summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2009-03-10 17:37:15 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2009-03-10 17:37:15 -0700
commita94c68228a29562c382a4587ce9cf18101f9babc (patch)
treec7b2216e26f73058c0f1ca06c0933e31cec1559d /src/mem/cache
parentac64586a99cad5aa8daf4346e1f6021764dbca1b (diff)
downloadgem5-a94c68228a29562c382a4587ce9cf18101f9babc.tar.xz
prefetch: don't panic on requests w/o contextID (e.g., writebacks).
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/prefetch/ghb.cc7
-rw-r--r--src/mem/cache/prefetch/stride.cc5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mem/cache/prefetch/ghb.cc b/src/mem/cache/prefetch/ghb.cc
index c27165248..f8f7de1db 100644
--- a/src/mem/cache/prefetch/ghb.cc
+++ b/src/mem/cache/prefetch/ghb.cc
@@ -34,13 +34,18 @@
* GHB Prefetcher implementation.
*/
+#include "base/trace.hh"
#include "mem/cache/prefetch/ghb.hh"
-#include "arch/isa_traits.hh"
void
GHBPrefetcher::calculatePrefetch(PacketPtr &pkt, std::list<Addr> &addresses,
std::list<Tick> &delays)
{
+ if (useContextId && !pkt->req->hasContextId()) {
+ DPRINTF(HWPrefetch, "ignoring request with no context ID");
+ return;
+ }
+
Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1);
int ctx_id = useContextId ? pkt->req->contextId() : 0;
assert(ctx_id < Max_Contexts);
diff --git a/src/mem/cache/prefetch/stride.cc b/src/mem/cache/prefetch/stride.cc
index cfd2469fa..8af4e615e 100644
--- a/src/mem/cache/prefetch/stride.cc
+++ b/src/mem/cache/prefetch/stride.cc
@@ -46,6 +46,11 @@ StridePrefetcher::calculatePrefetch(PacketPtr &pkt, std::list<Addr> &addresses,
return;
}
+ if (useContextId && !pkt->req->hasContextId()) {
+ DPRINTF(HWPrefetch, "ignoring request with no context ID");
+ return;
+ }
+
Addr blk_addr = pkt->getAddr() & ~(Addr)(blkSize-1);
int ctx_id = useContextId ? pkt->req->contextId() : 0;
Addr pc = pkt->req->getPC();