Fixes for uni-coherence in timing mode for FS.
authorRon Dreslinski <rdreslin@umich.edu>
Tue, 17 Oct 2006 22:50:19 +0000 (18:50 -0400)
committerRon Dreslinski <rdreslin@umich.edu>
Tue, 17 Oct 2006 22:50:19 +0000 (18:50 -0400)
Still a bug in atomic uni-coherence in FS.

src/cpu/o3/fetch_impl.hh:
src/cpu/o3/lsq_impl.hh:
src/cpu/simple/atomic.cc:
src/cpu/simple/timing.cc:
    Make CPU models handle coherence requests
src/mem/cache/base_cache.cc:
    Properly signal coherence CSHRs
src/mem/cache/coherence/uni_coherence.cc:
    Only deallocate once

--HG--
extra : convert_revision : c4533de421c371c5532ee505e3ecd451511f5c99

src/cpu/o3/fetch_impl.hh
src/cpu/o3/lsq_impl.hh
src/cpu/simple/atomic.cc
src/cpu/simple/timing.cc
src/mem/cache/base_cache.cc
src/mem/cache/coherence/uni_coherence.cc

index 07d4ebb42688326a60e4a8181fe26d6a6c2e7863..54b652813645ef8e8e991ff00e3017f9a3817256 100644 (file)
@@ -80,7 +80,10 @@ template<class Impl>
 bool
 DefaultFetch<Impl>::IcachePort::recvTiming(Packet *pkt)
 {
-    fetch->processCacheCompletion(pkt);
+    if (pkt->isResponse()) {
+        fetch->processCacheCompletion(pkt);
+    }
+    //else Snooped a coherence request, just return
     return true;
 }
 
index 7b7d1eb8e4e852ac0028de16043a4b3c25b6c21c..337ee037230920ac595347405ac07570e9b5b823 100644 (file)
@@ -63,7 +63,14 @@ template <class Impl>
 bool
 LSQ<Impl>::DcachePort::recvTiming(PacketPtr pkt)
 {
-    lsq->thread[pkt->req->getThreadNum()].completeDataAccess(pkt);
+    if (pkt->isResponse()) {
+        lsq->thread[pkt->req->getThreadNum()].completeDataAccess(pkt);
+    }
+    else {
+    //else it is a coherence request, maybe you need to do something
+        warn("Recieved a coherence request (Invalidate??), 03CPU doesn't"
+             "update LSQ for these\n");
+    }
     return true;
 }
 
index fe421ae6c8946efa42c2e2793ab1becce1c5bfcf..acda254c35c54249e73480bc1ffed9892ae7e281 100644 (file)
@@ -101,7 +101,7 @@ AtomicSimpleCPU::CpuPort::recvTiming(Packet *pkt)
 Tick
 AtomicSimpleCPU::CpuPort::recvAtomic(Packet *pkt)
 {
-    panic("AtomicSimpleCPU doesn't expect recvAtomic callback!");
+    //Snooping a coherence request, just return
     return curTick;
 }
 
index ad5c0e5d640990733c7069e38a4270c99f275944..0cc10ae948f209f3d7fbc4cfe92cb9bec315992d 100644 (file)
@@ -528,17 +528,23 @@ TimingSimpleCPU::IcachePort::ITickEvent::process()
 bool
 TimingSimpleCPU::IcachePort::recvTiming(Packet *pkt)
 {
-    // delay processing of returned data until next CPU clock edge
-    Tick time = pkt->req->getTime();
-    while (time < curTick)
-        time += lat;
-
-    if (time == curTick)
-        cpu->completeIfetch(pkt);
-    else
-        tickEvent.schedule(pkt, time);
-
-    return true;
+    if (pkt->isResponse()) {
+        // delay processing of returned data until next CPU clock edge
+        Tick time = pkt->req->getTime();
+        while (time < curTick)
+            time += lat;
+
+        if (time == curTick)
+            cpu->completeIfetch(pkt);
+        else
+            tickEvent.schedule(pkt, time);
+
+        return true;
+    }
+    else {
+        //Snooping a Coherence Request, do nothing
+        return true;
+    }
 }
 
 void
@@ -600,17 +606,23 @@ TimingSimpleCPU::completeDrain()
 bool
 TimingSimpleCPU::DcachePort::recvTiming(Packet *pkt)
 {
-    // delay processing of returned data until next CPU clock edge
-    Tick time = pkt->req->getTime();
-    while (time < curTick)
-        time += lat;
+    if (pkt->isResponse()) {
+        // delay processing of returned data until next CPU clock edge
+        Tick time = pkt->req->getTime();
+        while (time < curTick)
+            time += lat;
 
-    if (time == curTick)
-        cpu->completeDataAccess(pkt);
-    else
-        tickEvent.schedule(pkt, time);
+        if (time == curTick)
+            cpu->completeDataAccess(pkt);
+        else
+            tickEvent.schedule(pkt, time);
 
-    return true;
+        return true;
+    }
+    else {
+        //Snooping a coherence req, do nothing
+        return true;
+    }
 }
 
 void
index 6250b72d4ed764e8543df5e2bbf8ba003348ec8c..ebcf83b92615874e073ad965077f8801e5abf45a 100644 (file)
@@ -331,7 +331,7 @@ BaseCache::CacheEvent::process()
             pkt = cachePort->cache->getCoherencePacket();
             MSHR* cshr = (MSHR*) pkt->senderState;
             bool success = cachePort->sendTiming(pkt);
-            cachePort->cache->sendResult(pkt, cshr, success);
+            cachePort->cache->sendCoherenceResult(pkt, cshr, success);
             cachePort->waitingOnRetry = !success;
             if (cachePort->waitingOnRetry)
                 DPRINTF(CachePort, "%s now waiting on a retry\n", cachePort->name());
index 751de48019cba2f63f63cdb0642e85c81039191a..464266a29f0f534742211442d781ace42e571474 100644 (file)
@@ -53,11 +53,11 @@ UniCoherence::sendResult(Packet * &pkt, MSHR* cshr, bool success)
     if (success)
     {
         bool unblock = cshrs.isFull();
-        cshrs.markInService(cshr);
+//        cshrs.markInService(cshr);
+        cshrs.deallocate(cshr);
         if (!cshrs.havePending()) {
             cache->clearSlaveRequest(Request_Coherence);
         }
-        cshrs.deallocate(cshr);
         if (unblock) {
             //since CSHRs are always used as buffers, should always get rid of one
             assert(!cshrs.isFull());