changeset 3d5d3653eaa4 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=3d5d3653eaa4
description:
        MOESI_CMP_token: Fixed dma persistent lockdown bugs

diffstat:

 src/mem/protocol/MOESI_CMP_token-dir.sm |  74 +++++++++++++++++++++++++++-----
 1 files changed, 62 insertions(+), 12 deletions(-)

diffs (175 lines):

diff -r 90c5eb6a5e66 -r 3d5d3653eaa4 src/mem/protocol/MOESI_CMP_token-dir.sm
--- a/src/mem/protocol/MOESI_CMP_token-dir.sm   Fri Aug 20 11:46:12 2010 -0700
+++ b/src/mem/protocol/MOESI_CMP_token-dir.sm   Fri Aug 20 11:46:12 2010 -0700
@@ -63,6 +63,7 @@
     L_O_W, desc="transitioning to Locked, waiting for memory read, could 
eventually return to O";
     L_NO_W, desc="transitioning to Locked, waiting for memory read, eventually 
return to NO";
     DR_L_W, desc="transitioning to Locked underneath a DMA read, waiting for 
memory data";
+    DW_L_W, desc="transitioning to Locked underneath a DMA write, waiting for 
memory ack";
     NO_W, desc="transitioning to Not Owner, waiting for memory read";
     O_DW_W, desc="transitioning to Owner, waiting for memory before DMA ack";
     O_DR_W, desc="transitioning to Owner, waiting for memory before DMA data";
@@ -291,13 +292,19 @@
 
           // React to the message based on the current state of the table
           if (persistentTable.isLocked(in_msg.Address)) {
-            trigger(Event:Lockdown, in_msg.Address); // locked
+            if (persistentTable.findSmallest(in_msg.Address) == machineID) {
+              trigger(Event:Own_Lock_or_Unlock, in_msg.Address);
+            } else {
+              trigger(Event:Lockdown, in_msg.Address); // locked
+            }   
           } else {
             trigger(Event:Unlockdown, in_msg.Address); // unlocked
           }
         }
         else {
-          if (in_msg.Type == PersistentRequestType:GETX_PERSISTENT) {
+          if (persistentTable.findSmallest(in_msg.Address) == machineID) {
+            trigger(Event:Own_Lock_or_Unlock, in_msg.Address);
+          } else if (in_msg.Type == PersistentRequestType:GETX_PERSISTENT) {
             trigger(Event:Lockdown, in_msg.Address); // locked
           } else if (in_msg.Type == PersistentRequestType:GETS_PERSISTENT) {
             trigger(Event:Lockdown, in_msg.Address); // locked
@@ -685,6 +692,10 @@
     }
   }
 
+  action(aat_assertAllTokens, "aat", desc="assert that we have all tokens") {
+    assert(getDirectoryEntry(address).Tokens == max_tokens());
+  }
+
   action(j_popIncomingRequestQueue, "j", desc="Pop incoming request queue") {
     requestNetwork_in.dequeue();
   }
@@ -746,6 +757,16 @@
     }
   }
 
+  action(rs_resetScheduleTimeout, "rs", desc="Reschedule Schedule Timeout") {
+    //
+    // currently only support a fixed timeout latency
+    //
+    if (reissueTimerTable.isSet(address)) {
+      reissueTimerTable.unset(address);
+      reissueTimerTable.set(address, fixed_timeout_latency);
+    }
+  }
+
   action(st_scheduleTimeout, "st", desc="Schedule Timeout") {
     //
     // currently only support a fixed timeout latency
@@ -885,6 +906,10 @@
     k_popIncomingResponseQueue;
   }
 
+  transition({O, NO}, Unlockdown) {
+    l_popIncomingPersistentQueue;
+  }
+
   //
   // transitioning to Owner, waiting for memory before DMA ack
   // All other events should recycle/stall
@@ -1060,7 +1085,7 @@
     j_popIncomingRequestQueue;
   }
 
-  transition({L, DW_L, DR_L, L_O_W, L_NO_W, DR_L_W}, Lockdown) {
+  transition({L, DW_L, DR_L, L_O_W, L_NO_W, DR_L_W, DW_L_W}, Lockdown) {
     l_popIncomingPersistentQueue;
   }
 
@@ -1100,11 +1125,11 @@
     l_popMemQueue;
   }
 
-  transition(L_O_W, {Unlockdown, Own_Lock_or_Unlock}, O_W) {
+  transition(L_O_W, Unlockdown, O_W) {
     l_popIncomingPersistentQueue;
   }
 
-  transition(L_NO_W, {Unlockdown, Own_Lock_or_Unlock}, NO_W) {
+  transition(L_NO_W, Unlockdown, NO_W) {
     l_popIncomingPersistentQueue;
   }
 
@@ -1113,15 +1138,27 @@
     l_popMemQueue;
   }
 
+  transition(DW_L_W, Memory_Ack, L) {
+    aat_assertAllTokens;
+    da_sendDmaAck;
+    s_deallocateTBE;
+    dd_sendDataWithAllTokensToStarver;
+    l_popMemQueue;
+  }
+
   transition(DW_L, {Unlockdown, Own_Lock_or_Unlock}, NO_DW) {
     l_popIncomingPersistentQueue;
   }
 
-  transition(DR_L_W, {Unlockdown, Own_Lock_or_Unlock}, O_DR_W) {
+  transition(DR_L_W, Unlockdown, O_DR_W) {
     l_popIncomingPersistentQueue;
   }
 
-  transition({DW_L, DR_L_W}, Request_Timeout) {
+  transition(DW_L_W, Unlockdown, O_DW_W) {
+    l_popIncomingPersistentQueue;
+  }
+
+  transition({DW_L, DR_L_W, DW_L_W}, Request_Timeout) {
     ut_unsetReissueTimer;
     px_tryIssuingPersistentGETXRequest;
   }
@@ -1143,23 +1180,32 @@
     l_popMemQueue; 
   }
 
-  transition({O, NO, L, O_DW, NO_DW, NO_DR}, Own_Lock_or_Unlock) {
+  transition({O, NO, O_DW, NO_DW, NO_DR}, Own_Lock_or_Unlock) {
     l_popIncomingPersistentQueue;
   }
 
   // Blocked states
-  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, O_DW_W, O_DR_W, O_DW, NO_DW, 
NO_DR}, {GETX, GETS}) {
+  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, DW_L_W, O_DW_W, O_DR_W, O_DW, 
NO_DW, NO_DR}, {GETX, GETS}) {
     z_recycleRequest;
   }
 
-  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, O_DW_W, O_DR_W, O_DW, NO_DW, 
NO_DR, L, DW_L, DR_L}, {DMA_READ, DMA_WRITE}) {
+  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, DW_L_W, O_DW_W, O_DR_W, O_DW, 
NO_DW, NO_DR, L, DW_L, DR_L}, {DMA_READ, DMA_WRITE, DMA_WRITE_All_Tokens}) {
     y_recycleDmaRequestQueue;
   }
 
-  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, O_DW_W, O_DR_W}, {Data_Owner, 
Ack_Owner, Tokens, Ack_All_Tokens}) {
+  transition({NO_W, O_W, L_O_W, L_NO_W, DR_L_W, DW_L_W, O_DW_W, O_DR_W}, 
{Data_Owner, Ack_Owner, Tokens, Ack_All_Tokens}) {
     kz_recycleResponse;
   }
 
+  //
+  // If we receive a request timeout while waiting for memory, it is likely 
that
+  // the request will be satisfied and issuing a presistent request will do us
+  // no good.  Just wait.
+  //
+  transition({O_DW_W, O_DR_W}, Request_Timeout) {
+    rs_resetScheduleTimeout;
+  }
+
   transition(NO_W, Lockdown, L_NO_W) {
     l_popIncomingPersistentQueue;
   }
@@ -1172,7 +1218,11 @@
     l_popIncomingPersistentQueue;
   }
 
-  transition({NO_W, O_W, O_DR_W}, {Unlockdown, Own_Lock_or_Unlock}) {
+  transition(O_DW_W, Lockdown, DW_L_W) {
+    l_popIncomingPersistentQueue;
+  }
+
+  transition({NO_W, O_W, O_DR_W, O_DW_W}, {Unlockdown, Own_Lock_or_Unlock}) {
     l_popIncomingPersistentQueue;
   }
 }
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to