Handle NACK's that occur from devices on the same bus.
authorRon Dreslinski <rdreslin@umich.edu>
Tue, 10 Oct 2006 00:18:00 +0000 (20:18 -0400)
committerRon Dreslinski <rdreslin@umich.edu>
Tue, 10 Oct 2006 00:18:00 +0000 (20:18 -0400)
Not fully implemented yet, but good enough for single level cache coherence

src/mem/packet.hh:
    Add a bit to distinguish invalidates and upgrades

--HG--
extra : convert_revision : 5bf50d535857cea37fbdaf7993915d1332cb757e

src/mem/cache/cache_impl.hh
src/mem/packet.hh

index c3c1c08819cd758acf5fd6bb954e840d478ed756..5c12075cdf3599f0f0424a2dd2473e625f19ada0 100644 (file)
@@ -287,13 +287,17 @@ template<class TagStore, class Buffering, class Coherence>
 void
 Cache<TagStore,Buffering,Coherence>::sendResult(PacketPtr &pkt, MSHR* mshr, bool success)
 {
-    if (success) {
+    if (success && !(pkt->flags & NACKED_LINE)) {
               missQueue->markInService(pkt, mshr);
           //Temp Hack for UPGRADES
           if (pkt->cmd == Packet::UpgradeReq) {
+              pkt->flags &= ~CACHE_LINE_FILL;
               handleResponse(pkt);
           }
     } else if (pkt && !pkt->req->isUncacheable()) {
+        pkt->flags &= ~NACKED_LINE;
+        pkt->flags &= ~SATISFIED;
+        pkt->flags &= ~SNOOP_COMMIT;
         missQueue->restoreOrigCmd(pkt);
     }
 }
@@ -305,8 +309,9 @@ Cache<TagStore,Buffering,Coherence>::handleResponse(Packet * &pkt)
     BlkType *blk = NULL;
     if (pkt->senderState) {
         if (pkt->result == Packet::Nacked) {
-            pkt->reinitFromRequest();
-            panic("Unimplemented NACK of packet\n");
+            //pkt->reinitFromRequest();
+            warn("NACKs from devices not connected to the same bus not implemented\n");
+            return;
         }
         if (pkt->result == Packet::BadAddress) {
             //Make the response a Bad address and send it
@@ -397,7 +402,8 @@ Cache<TagStore,Buffering,Coherence>::snoop(Packet * &pkt)
                     assert(!(pkt->flags & SATISFIED));
                     pkt->flags |= SATISFIED;
                     pkt->flags |= NACKED_LINE;
-                    respondToSnoop(pkt, curTick + hitLatency);
+                    warn("NACKs from devices not connected to the same bus not implemented\n");
+                    //respondToSnoop(pkt, curTick + hitLatency);
                     return;
                 }
                 else {
index 56c4caffe0309baa2383b39b9e798131921730c7..e8cbfd10efc4d9a4a6a788d225cf82a2fbe27855 100644 (file)
@@ -174,7 +174,8 @@ class Packet
         IsResponse     = 1 << 5,
         NeedsResponse  = 1 << 6,
         IsSWPrefetch    = 1 << 7,
-        IsHWPrefetch    = 1 << 8
+        IsHWPrefetch    = 1 << 8,
+        IsUpgrade       = 1 << 9
     };
 
   public:
@@ -194,7 +195,7 @@ class Packet
         HardPFResp      = IsRead  | IsResponse | IsHWPrefetch | NeedsResponse,
         InvalidateReq   = IsInvalidate | IsRequest,
         WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,
-        UpgradeReq      = IsInvalidate | IsRequest,
+        UpgradeReq      = IsInvalidate | IsRequest | IsUpgrade,
         ReadExReq       = IsRead | IsInvalidate | IsRequest | NeedsResponse,
         ReadExResp      = IsRead | IsInvalidate | IsResponse | NeedsResponse
     };