From 288b98eb695f7ee508df523e87431181ee878d66 Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Tue, 17 Oct 2006 15:05:21 -0400 Subject: Fix it so that the cache does not assume to gave the packet it sent out via sendTiming. Still need to fix upgrades to use this path src/mem/cache/base_cache.cc: Copy the pkt to the MSHR before issuing the sendTiming where it may be changed/consumed src/mem/cache/cache_impl.hh: Use copy of packet, because sendTiming may have changed the pkt Also, delete the copy when the time comes --HG-- extra : convert_revision : 635cde6b4f08d010affde310c46b1caf50fbe424 --- src/mem/cache/base_cache.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mem/cache/base_cache.cc') diff --git a/src/mem/cache/base_cache.cc b/src/mem/cache/base_cache.cc index 938bd8786..30c996d4f 100644 --- a/src/mem/cache/base_cache.cc +++ b/src/mem/cache/base_cache.cc @@ -36,6 +36,7 @@ #include "mem/cache/base_cache.hh" #include "cpu/smt.hh" #include "cpu/base.hh" +#include "mem/cache/miss/mshr.hh" using namespace std; @@ -179,6 +180,10 @@ BaseCache::CachePort::recvRetry() } pkt = cache->getPacket(); MSHR* mshr = (MSHR*)pkt->senderState; + //Copy the packet, it may be modified/destroyed elsewhere + Packet * copyPkt = new Packet(*pkt); + copyPkt->dataStatic(pkt->getPtr()); + mshr->pkt = copyPkt; bool success = sendTiming(pkt); DPRINTF(Cache, "Address %x was %s in sending the timing request\n", pkt->getAddr(), success ? "succesful" : "unsuccesful"); @@ -288,6 +293,11 @@ BaseCache::CacheEvent::process() pkt = cachePort->cache->getPacket(); MSHR* mshr = (MSHR*) pkt->senderState; + //Copy the packet, it may be modified/destroyed elsewhere + Packet * copyPkt = new Packet(*pkt); + copyPkt->dataStatic(pkt->getPtr()); + mshr->pkt = copyPkt; + bool success = cachePort->sendTiming(pkt); DPRINTF(Cache, "Address %x was %s in sending the timing request\n", pkt->getAddr(), success ? "succesful" : "unsuccesful"); -- cgit v1.2.3