One step closet to having NACK's work.

src/cpu/memtest/memtest.cc:
    Fix functional return path
src/cpu/memtest/memtest.hh:
    Add snoop ranges in
src/mem/cache/base_cache.cc:
    Properly signal NACKED
src/mem/cache/cache_impl.hh:
    Catch nacked packet and panic for now

--HG--
extra : convert_revision : 59a64e82254dfa206681c5f987e6939167754d67
This commit is contained in:
Ron Dreslinski 2006-10-09 18:52:20 -04:00
parent 727dea78c4
commit 13ac9a419d
4 changed files with 17 additions and 7 deletions

View file

@ -71,7 +71,8 @@ MemTest::CpuPort::recvAtomic(Packet *pkt)
void void
MemTest::CpuPort::recvFunctional(Packet *pkt) MemTest::CpuPort::recvFunctional(Packet *pkt)
{ {
memtest->completeRequest(pkt); //Do nothing if we see one come through
return;
} }
void void
@ -325,7 +326,7 @@ MemTest::tick()
} else { } else {
paddr = ((base) ? baseAddr1 : baseAddr2) + offset; paddr = ((base) ? baseAddr1 : baseAddr2) + offset;
} }
// bool probe = (random() % 2 == 1) && !req->isUncacheable(); //bool probe = (random() % 2 == 1) && !req->isUncacheable();
bool probe = false; bool probe = false;
paddr &= ~((1 << access_size) - 1); paddr &= ~((1 << access_size) - 1);
@ -364,7 +365,7 @@ MemTest::tick()
if (probe) { if (probe) {
cachePort.sendFunctional(pkt); cachePort.sendFunctional(pkt);
// completeRequest(pkt, result); completeRequest(pkt);
} else { } else {
// req->completionEvent = new MemCompleteEvent(req, result, this); // req->completionEvent = new MemCompleteEvent(req, result, this);
if (!cachePort.sendTiming(pkt)) { if (!cachePort.sendTiming(pkt)) {

View file

@ -113,7 +113,7 @@ class MemTest : public MemObject
virtual void getDeviceAddressRanges(AddrRangeList &resp, virtual void getDeviceAddressRanges(AddrRangeList &resp,
AddrRangeList &snoop) AddrRangeList &snoop)
{ resp.clear(); snoop.clear(); } { resp.clear(); snoop.clear(); snoop.push_back(RangeSize(0,-1)); }
}; };
CpuPort cachePort; CpuPort cachePort;

View file

@ -217,7 +217,10 @@ BaseCache::CacheEvent::process()
} }
//Response //Response
//Know the packet to send //Know the packet to send
pkt->result = Packet::Success; if (pkt->flags & NACKED_LINE)
pkt->result = Packet::Nacked;
else
pkt->result = Packet::Success;
pkt->makeTimingResponse(); pkt->makeTimingResponse();
if (!cachePort->drainList.empty()) { if (!cachePort->drainList.empty()) {
//Already blocked waiting for bus, just append //Already blocked waiting for bus, just append

View file

@ -306,6 +306,13 @@ Cache<TagStore,Buffering,Coherence>::handleResponse(Packet * &pkt)
{ {
BlkType *blk = NULL; BlkType *blk = NULL;
if (pkt->senderState) { if (pkt->senderState) {
if (pkt->result == Packet::Nacked) {
pkt->reinitFromRequest();
panic("Unimplemented NACK of packet\n");
}
if (pkt->result == Packet::BadAddress) {
//Make the response a Bad address and send it
}
// MemDebug::cacheResponse(pkt); // MemDebug::cacheResponse(pkt);
DPRINTF(Cache, "Handling reponse to %x, blk addr: %x\n",pkt->getAddr(), DPRINTF(Cache, "Handling reponse to %x, blk addr: %x\n",pkt->getAddr(),
pkt->getAddr() & (((ULL(1))<<48)-1)); pkt->getAddr() & (((ULL(1))<<48)-1));
@ -392,7 +399,6 @@ Cache<TagStore,Buffering,Coherence>::snoop(Packet * &pkt)
assert(!(pkt->flags & SATISFIED)); assert(!(pkt->flags & SATISFIED));
pkt->flags |= SATISFIED; pkt->flags |= SATISFIED;
pkt->flags |= NACKED_LINE; pkt->flags |= NACKED_LINE;
assert("Don't detect these on the other side yet\n");
respondToSnoop(pkt, curTick + hitLatency); respondToSnoop(pkt, curTick + hitLatency);
return; return;
} }
@ -406,7 +412,7 @@ Cache<TagStore,Buffering,Coherence>::snoop(Packet * &pkt)
//@todo Make it so that a read to a pending read can't be exclusive now. //@todo Make it so that a read to a pending read can't be exclusive now.
//Set the address so find match works //Set the address so find match works
assert("Don't have invalidates yet\n"); panic("Don't have invalidates yet\n");
invalidatePkt->addrOverride(pkt->getAddr()); invalidatePkt->addrOverride(pkt->getAddr());
//Append the invalidate on //Append the invalidate on