Update statistics to use cycles properly instead of ticks
[gem5.git] / src / mem / tport.cc
index a4f791048180282294987e95429649863f36ee12..9fa27046b30b52374788131bddf78b29a4401477 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "mem/tport.hh"
 
-void
+bool
 SimpleTimingPort::checkFunctional(PacketPtr pkt)
 {
     DeferredPacketIterator i = transmitList.begin();
@@ -41,19 +41,20 @@ SimpleTimingPort::checkFunctional(PacketPtr pkt)
         // If the target contains data, and it overlaps the
         // probed request, need to update data
         if (pkt->checkFunctional(target)) {
-            return;
+            return true;
         }
     }
+
+    return false;
 }
 
 void
 SimpleTimingPort::recvFunctional(PacketPtr pkt)
 {
-    checkFunctional(pkt);
-
-    // Just do an atomic access and throw away the returned latency
-    if (!pkt->isResponse())
+    if (!checkFunctional(pkt)) {
+        // Just do an atomic access and throw away the returned latency
         recvAtomic(pkt);
+    }
 }
 
 bool
@@ -69,7 +70,6 @@ SimpleTimingPort::recvTiming(PacketPtr pkt)
     if (pkt->memInhibitAsserted()) {
         // snooper will supply based on copy of packet
         // still target's responsibility to delete packet
-        delete pkt->req;
         delete pkt;
         return true;
     }
@@ -95,6 +95,7 @@ void
 SimpleTimingPort::schedSendTiming(PacketPtr pkt, Tick when)
 {
     assert(when > curTick);
+    assert(when < curTick + Clock::Int::ms);
 
     // Nothing is on the list: add it and schedule an event
     if (transmitList.empty() || when < transmitList.front().tick) {