Eliminate unused PacketPtr from BaseCache's
authorSteve Reinhardt <stever@eecs.umich.edu>
Mon, 14 May 2007 06:09:10 +0000 (23:09 -0700)
committerSteve Reinhardt <stever@eecs.umich.edu>
Mon, 14 May 2007 06:09:10 +0000 (23:09 -0700)
RequestEvent and ResponseEvent.
Compiles but not tested.

--HG--
extra : convert_revision : cc791e7adea5b0406e986a0076edba51856b9105

src/mem/cache/base_cache.cc
src/mem/cache/base_cache.hh

index 60e8028e8e55b8b5997cddab6eecef63a2aef8c5..3ed4b84d110e2c1ab973bd17bfbb0337aff815ee 100644 (file)
@@ -229,7 +229,6 @@ BaseCache::RequestEvent::RequestEvent(CachePort *_cachePort, Tick when)
     : Event(&mainEventQueue, CPU_Tick_Pri), cachePort(_cachePort)
 {
     this->setFlags(AutoDelete);
-    pkt = NULL;
     schedule(when);
 }
 
@@ -266,7 +265,7 @@ BaseCache::RequestEvent::process()
             return;
         }
 
-        pkt = cachePort->cache->getPacket();
+        PacketPtr pkt = cachePort->cache->getPacket();
         MSHR* mshr = (MSHR*) pkt->senderState;
         //Copy the packet, it may be modified/destroyed elsewhere
         PacketPtr copyPkt = new Packet(*pkt);
@@ -288,7 +287,6 @@ BaseCache::RequestEvent::process()
             DPRINTF(CachePort, "%s still more MSHR requests to send\n",
                     cachePort->name());
             //Still more to issue, rerequest in 1 cycle
-            pkt = NULL;
             this->schedule(curTick+1);
         }
     }
@@ -296,7 +294,7 @@ BaseCache::RequestEvent::process()
     {
         //CSHR
         assert(cachePort->cache->doSlaveRequest());
-        pkt = cachePort->cache->getCoherencePacket();
+        PacketPtr pkt = cachePort->cache->getCoherencePacket();
         MSHR* cshr = (MSHR*) pkt->senderState;
         bool success = cachePort->sendTiming(pkt);
         cachePort->cache->sendCoherenceResult(pkt, cshr, success);
@@ -308,7 +306,6 @@ BaseCache::RequestEvent::process()
             DPRINTF(CachePort, "%s still more CSHR requests to send\n",
                     cachePort->name());
             //Still more to issue, rerequest in 1 cycle
-            pkt = NULL;
             this->schedule(curTick+1);
         }
     }
@@ -323,7 +320,6 @@ BaseCache::RequestEvent::description()
 BaseCache::ResponseEvent::ResponseEvent(CachePort *_cachePort)
     : Event(&mainEventQueue, CPU_Tick_Pri), cachePort(_cachePort)
 {
-    pkt = NULL;
 }
 
 void
@@ -331,7 +327,7 @@ BaseCache::ResponseEvent::process()
 {
     assert(cachePort->transmitList.size());
     assert(cachePort->transmitList.front().first <= curTick);
-    pkt = cachePort->transmitList.front().second;
+    PacketPtr pkt = cachePort->transmitList.front().second;
     cachePort->transmitList.pop_front();
     if (!cachePort->transmitList.empty()) {
         Tick time = cachePort->transmitList.front().first;
index 0f2baa3065314c41b9a38fa7f07e1bc454a79655..e45e36fa0ee001466a81d8f17a1c124f23e58630 100644 (file)
@@ -120,7 +120,6 @@ class BaseCache : public MemObject
     struct RequestEvent : public Event
     {
         CachePort *cachePort;
-        PacketPtr pkt;
 
         RequestEvent(CachePort *_cachePort, Tick when);
         void process();
@@ -130,7 +129,6 @@ class BaseCache : public MemObject
     struct ResponseEvent : public Event
     {
         CachePort *cachePort;
-        PacketPtr pkt;
 
         ResponseEvent(CachePort *_cachePort);
         void process();