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
This commit is contained in:
Ron Dreslinski 2006-10-07 12:02:59 -04:00
parent 2c336f0a1f
commit df3014a726
2 changed files with 15 additions and 1 deletions

View file

@ -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 *

View file

@ -110,6 +110,8 @@ class BaseCache : public MemObject
bool mustSendRetry;
bool isCpuSide;
std::list<Packet *> drainList;
};
struct CacheEvent : public Event