mem-ruby: Use check_on_cache_probe on MOESI hammer
authorPouya Fotouhi <Pouya.Fotouhi@amd.com>
Thu, 8 Aug 2019 01:11:26 +0000 (20:11 -0500)
committerPouya Fotouhi <pfotouhi@ucdavis.edu>
Tue, 13 Aug 2019 00:52:16 +0000 (00:52 +0000)
This change uses check_on_cache_probe statement to check if the cacheline
subject to eviction is locked in MOESI hammer.

Change-Id: I2c43f22aba5af3a57e54b1c435e5d3fbba86d1d5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19891
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/mem/protocol/MOESI_hammer-cache.sm

index 9cbd277d4fb82f22a0d7f2c79c08b1612aaab943..4086f42a875d079942d9a6f0d505b67b853b8d58 100644 (file)
@@ -468,7 +468,9 @@ machine(MachineType:L1Cache, "AMD Hammer-like protocol")
               }
             } else {
               // No room in the L1, so we need to make room
+              // Check if the line we want to evict is not locked
               Addr l1i_victim_addr := L1Icache.cacheProbe(in_msg.LineAddress);
+              check_on_cache_probe(mandatoryQueue_in, l1i_victim_addr);
               if (L2cache.cacheAvail(l1i_victim_addr)) {
                 // The L2 has room, so we move the line from the L1 to the L2
                 trigger(Event:L1_to_L2,
@@ -525,7 +527,9 @@ machine(MachineType:L1Cache, "AMD Hammer-like protocol")
               }
             } else {
               // No room in the L1, so we need to make room
+              // Check if the line we want to evict is not locked
               Addr l1d_victim_addr := L1Dcache.cacheProbe(in_msg.LineAddress);
+              check_on_cache_probe(mandatoryQueue_in, l1i_victim_addr);
               if (L2cache.cacheAvail(l1d_victim_addr)) {
                 // The L2 has room, so we move the line from the L1 to the L2
                 trigger(Event:L1_to_L2,