From: Pouya Fotouhi Date: Wed, 27 Feb 2019 21:47:57 +0000 (-0800) Subject: mem-ruby: Use check_on_cache_probe to protect locked lines from eviction X-Git-Tag: v19.0.0.0~664 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e424be8281cfca6b05297a9d51ca979b555bdfca;p=gem5.git mem-ruby: Use check_on_cache_probe to protect locked lines from eviction This change uses check_on_cache_probe statement to check if the cacheline subject to eviction is locked in MESI Two Level. Other protocols should be updated accordingly. Signed-off-by: Pouya Fotouhi Change-Id: Idcdbc8ee528eb5e4e2f8d56a268a3a92eadd95b1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16809 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/mem/protocol/MESI_Two_Level-L1cache.sm b/src/mem/protocol/MESI_Two_Level-L1cache.sm index 87684ce10..51d3f621c 100644 --- a/src/mem/protocol/MESI_Two_Level-L1cache.sm +++ b/src/mem/protocol/MESI_Two_Level-L1cache.sm @@ -472,9 +472,14 @@ machine(MachineType:L1Cache, "MESI Directory L1 Cache CMP") L1Icache_entry, TBEs[in_msg.LineAddress]); } else { // No room in the L1, so we need to make room in the L1 - trigger(Event:L1_Replacement, L1Icache.cacheProbe(in_msg.LineAddress), - getL1ICacheEntry(L1Icache.cacheProbe(in_msg.LineAddress)), - TBEs[L1Icache.cacheProbe(in_msg.LineAddress)]); + + // Check if the line we want to evict is not locked + Addr addr := L1Icache.cacheProbe(in_msg.LineAddress); + check_on_cache_probe(mandatoryQueue_in, addr); + + trigger(Event:L1_Replacement, addr, + getL1ICacheEntry(addr), + TBEs[addr]); } } } else { @@ -502,9 +507,14 @@ machine(MachineType:L1Cache, "MESI Directory L1 Cache CMP") L1Dcache_entry, TBEs[in_msg.LineAddress]); } else { // No room in the L1, so we need to make room in the L1 - trigger(Event:L1_Replacement, L1Dcache.cacheProbe(in_msg.LineAddress), - getL1DCacheEntry(L1Dcache.cacheProbe(in_msg.LineAddress)), - TBEs[L1Dcache.cacheProbe(in_msg.LineAddress)]); + + // Check if the line we want to evict is not locked + Addr addr := L1Dcache.cacheProbe(in_msg.LineAddress); + check_on_cache_probe(mandatoryQueue_in, addr); + + trigger(Event:L1_Replacement, addr, + getL1DCacheEntry(addr), + TBEs[addr]); } } }