MOESI_hammer: Fixed uniprocessor DMA bug
authorBrad Beckmann <Brad.Beckmann@amd.com>
Thu, 7 Jul 2011 01:44:42 +0000 (18:44 -0700)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Thu, 7 Jul 2011 01:44:42 +0000 (18:44 -0700)
src/mem/protocol/MOESI_hammer-cache.sm
src/mem/protocol/MOESI_hammer-dir.sm

index edb1587e3750b9287c23cd53f13a72ed8a50d57b..9576ba1afdd1fd2dc99cb44fe1fd5aeda939e758 100644 (file)
@@ -545,6 +545,21 @@ machine(L1Cache, "AMD Hammer-like protocol")
     }
   }
 
+  action(b_issueGETXIfMoreThanOne, "bo", desc="Issue GETX") {
+    if (machineCount(MachineType:L1Cache) > 1) {
+      enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
+        assert(is_valid(tbe));
+        out_msg.Address := address;
+        out_msg.Type := CoherenceRequestType:GETX;
+        out_msg.Requestor := machineID;
+        out_msg.Destination.add(map_Address_to_Directory(address));
+        out_msg.MessageSize := MessageSizeType:Request_Control;
+        out_msg.InitialRequestTime := get_time();
+      }
+    }
+    tbe.NumPendingMsgs := machineCount(MachineType:L1Cache); // One from each other cache (n-1) plus the memory (+1)
+  }
+
   action(bf_issueGETF, "bf", desc="Issue GETF") {
     enqueue(requestNetwork_out, RequestMsg, latency=issue_latency) {
       assert(is_valid(tbe));
@@ -921,7 +936,7 @@ machine(L1Cache, "AMD Hammer-like protocol")
 
   action(m_decrementNumberOfMessages, "m", desc="Decrement the number of messages for which we're waiting") {
     peek(responseToCache_in, ResponseMsg) {
-      assert(in_msg.Acks > 0);
+      assert(in_msg.Acks >= 0);
       assert(is_valid(tbe));
       DPRINTF(RubySlicc, "Sender = %s\n", in_msg.Sender);
       DPRINTF(RubySlicc, "SilentAcks = %d\n", in_msg.SilentAcks);
index bb0a97ac4a4c1903026890ec0ae35572438916e2..a4f4bf17afc3df8cd29030b25c1eeb4ab28efc6c 100644 (file)
@@ -951,6 +951,20 @@ machine(Directory, "AMD Hammer-like protocol")
             }
         }
       }
+    } else {
+      peek(requestQueue_in, RequestMsg) {
+          enqueue(responseNetwork_out, ResponseMsg, latency="1") {
+            out_msg.Address := address;
+            out_msg.Type := CoherenceResponseType:ACK;
+            out_msg.Sender := machineID;
+            out_msg.Destination.add(in_msg.Requestor);
+            out_msg.Dirty := false; // By definition, the block is now clean
+            out_msg.Acks := 0;
+            out_msg.SilentAcks := 0;
+            DPRINTF(RubySlicc, "%d\n", out_msg.Acks);
+            out_msg.MessageSize := MessageSizeType:Response_Control;
+          }
+      }
     }
   }