From df3014a7262c6f1311217eeeff31017f5d46f216 Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Sat, 7 Oct 2006 12:02:59 -0400 Subject: [PATCH] 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 --- src/mem/cache/base_cache.cc | 14 +++++++++++++- src/mem/cache/base_cache.hh | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 drainList; }; struct CacheEvent : public Event -- 2.30.2