summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-10-07 12:02:59 -0400
committerRon Dreslinski <rdreslin@umich.edu>2006-10-07 12:02:59 -0400
commitdf3014a7262c6f1311217eeeff31017f5d46f216 (patch)
tree8f29e1c9b736fa62325838cc716e038c7c74389c
parent2c336f0a1f7d0ae06f653a8c26c5de58b98cd855 (diff)
downloadgem5-df3014a7262c6f1311217eeeff31017f5d46f216.tar.xz
Add mechanism for caches to handle failure of the fast path on responses.
For now, responses have priority over requests (may want to revist this). src/mem/cache/base_cache.cc: src/mem/cache/base_cache.hh: Add mechanism for caches to handle failure of the fast path on responses. --HG-- extra : convert_revision : 01524c727d1bb300cc21bdc989eb862ec8bf0b7a
-rw-r--r--src/mem/cache/base_cache.cc14
-rw-r--r--src/mem/cache/base_cache.hh2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/mem/cache/base_cache.cc b/src/mem/cache/base_cache.cc
index e6138e320..fd97ea3aa 100644
--- a/src/mem/cache/base_cache.cc
+++ b/src/mem/cache/base_cache.cc
@@ -96,6 +96,15 @@ void
BaseCache::CachePort::recvRetry()
{
Packet *pkt;
+ if (!drainList.empty()) {
+ //We have some responses to drain first
+ bool result = true;
+ while (result && !drainList.empty()) {
+ result = sendTiming(drainList.front());
+ if (result)
+ drainList.pop_front();
+ }
+ }
if (!isCpuSide)
{
@@ -202,7 +211,10 @@ BaseCache::CacheEvent::process()
//Know the packet to send
pkt->result = Packet::Success;
pkt->makeTimingResponse();
- assert(cachePort->sendTiming(pkt));
+ if (!cachePort->sendTiming(pkt)) {
+ //It failed, save it to list of drain events
+ cachePort->drainList.push_back(pkt);
+ }
}
const char *
diff --git a/src/mem/cache/base_cache.hh b/src/mem/cache/base_cache.hh
index 7c16398aa..c69fb7fd5 100644
--- a/src/mem/cache/base_cache.hh
+++ b/src/mem/cache/base_cache.hh
@@ -110,6 +110,8 @@ class BaseCache : public MemObject
bool mustSendRetry;
bool isCpuSide;
+
+ std::list<Packet *> drainList;
};
struct CacheEvent : public Event