mem-ruby: Fix wakeup timeouts for the MOESI_CMP_token protocol
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Wed, 3 Jan 2018 11:10:09 +0000 (12:10 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Thu, 11 Jan 2018 09:40:35 +0000 (09:40 +0000)
This changeset fixes a bug that was affecting the MOESI_CMP_token
protocol where setting the next timeout required an absolute tick in
the future.

Change-Id: Ibfdb59354e13c7e552cb3389e71bda010f333249
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/7163
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/mem/protocol/MOESI_CMP_token-dir.sm

index 1a749b18d30189d699e136cf63bbb8b8a689a282..b9b65b5857638897073310e17609bea4716a3735 100644 (file)
@@ -173,6 +173,7 @@ machine(MachineType:Directory, "Token protocol")
   int l2_select_low_bit, default="RubySystem::getBlockSizeBits()";
 
   Tick clockEdge();
+  Tick clockEdge(Cycles c);
   Tick cyclesToTicks(Cycles c);
   void set_tbe(TBE b);
   void unset_tbe();
@@ -494,7 +495,7 @@ machine(MachineType:Directory, "Token protocol")
       // IssueCount.
 
       // Set a wakeup timer
-      reissueTimerTable.set(address, cyclesToTicks(reissue_wakeup_latency));
+      reissueTimerTable.set(address, clockEdge(reissue_wakeup_latency));
     }
   }
 
@@ -562,7 +563,7 @@ machine(MachineType:Directory, "Token protocol")
       // IssueCount.
 
       // Set a wakeup timer
-      reissueTimerTable.set(address, cyclesToTicks(reissue_wakeup_latency));
+      reissueTimerTable.set(address, clockEdge(reissue_wakeup_latency));
     }
   }
 
@@ -808,7 +809,7 @@ machine(MachineType:Directory, "Token protocol")
     //
     if (reissueTimerTable.isSet(address)) {
       reissueTimerTable.unset(address);
-      reissueTimerTable.set(address, cyclesToTicks(fixed_timeout_latency));
+      reissueTimerTable.set(address, clockEdge(fixed_timeout_latency));
     }
   }
 
@@ -816,7 +817,7 @@ machine(MachineType:Directory, "Token protocol")
     //
     // currently only support a fixed timeout latency
     //
-    reissueTimerTable.set(address, cyclesToTicks(fixed_timeout_latency));
+    reissueTimerTable.set(address, clockEdge(fixed_timeout_latency));
   }
 
   action(ut_unsetReissueTimer, "ut", desc="Unset reissue timer.") {