mem-ruby: Fix cache hits being profiled as cache misses
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Fri, 20 Nov 2020 04:08:14 +0000 (20:08 -0800)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Sat, 21 Nov 2020 00:47:51 +0000 (00:47 +0000)
There are some instances where a cache hit is profiled as a cache
miss. This commit addresses this error.

Change-Id: I7dafa806ef3f1e3717650dc25f8657a0ea741dd1
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37835
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Daniel Gerzhoy <daniel.gerzhoy@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/protocol/MI_example-cache.sm
src/mem/ruby/protocol/MOESI_AMD_Base-CorePair.sm
src/mem/ruby/protocol/MOESI_hammer-cache.sm

index 8738f336eaaed5879bc87b9a2f7c05832bf4a7c3..2c9bdb789a7d14bccfdf2e62eebe46352b6a19e6 100644 (file)
@@ -353,7 +353,7 @@ machine(MachineType:L1Cache, "MI Example L1 Cache")
       ++cacheMemory.demand_misses;
   }
 
-  action(p_profileHit, "ph", desc="Profile cache miss") {
+  action(p_profileHit, "ph", desc="Profile cache hit") {
       ++cacheMemory.demand_hits;
   }
 
index a9589d63ae63ad0d6d204069969fd631fae1b6a0..fb957f087281d657bdfe3543c5e0e52985131b45 100644 (file)
@@ -1283,19 +1283,19 @@ machine(MachineType:CorePair, "CP-like Core Coherence")
   }
 
   action(l10h_profileHit, "l10h", desc="l10h hit profile") {
-    ++L1D0cache.demand_misses;
+    ++L1D0cache.demand_hits;
   }
 
   action(l11h_profileHit, "l11h", desc="l11h hit profile") {
-    ++L1D1cache.demand_misses;
+    ++L1D1cache.demand_hits;
   }
 
   action(l1ih_profileHit, "l1lh", desc="l1ih hit profile") {
-    ++L1Icache.demand_misses;
+    ++L1Icache.demand_hits;
   }
 
   action(l2h_profileHit, "l2h", desc="l2h hit profile") {
-    ++L2cache.demand_misses;
+    ++L2cache.demand_hits;
   }
 
   action(yy_recycleProbeQueue, "yy", desc="recycle probe queue") {
index 8541f3541058f7b93738c9ecd4c464f8267a80a8..5440eb8e2f6f3d61f90c202b8330f39b7e15e8f3 100644 (file)
@@ -1285,12 +1285,12 @@ machine(MachineType:L1Cache, "AMD Hammer-like protocol")
       ++L2cache.demand_misses;
   }
 
-  action(uu_profileL2Hit, "\uh", desc="Profile the demand hits ") {
+  action(uu_profileL2Hit, "\uh", desc="Profile the demand hits") {
       ++L2cache.demand_hits;
   }
 
   action(zz_stallAndWaitMandatoryQueue, "\z", desc="Send the head of the mandatory queue to the back of the queue.") {
-    stall_and_wait(mandatoryQueue_in, address);    
+    stall_and_wait(mandatoryQueue_in, address);
   }
 
   action(z_stall, "z", desc="stall") {