summaryrefslogtreecommitdiff
path: root/src/mem/cache/replacement_policies/ReplacementPolicies.py
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-03-23 16:08:51 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-05-03 14:26:58 +0000
commit04d236e5687ba11d71ced0a37044fdd55aa5bb42 (patch)
tree2db8621bd8889b0ac06875f2fe6c6228676df720 /src/mem/cache/replacement_policies/ReplacementPolicies.py
parentc149983d931054d8cf88d2977a1f03a0b8b3b543 (diff)
downloadgem5-04d236e5687ba11d71ced0a37044fdd55aa5bb42.tar.xz
mem-cache: Create Second-Chance replacement policy
Implementation of a Second-Chance replacement policy. Similar to FIFO, but every block is given a second chance if it has been touched. Change-Id: Id4d52b698d0045a4914a4d848fdf9c3c00a28508 Reviewed-on: https://gem5-review.googlesource.com/9441 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/replacement_policies/ReplacementPolicies.py')
-rw-r--r--src/mem/cache/replacement_policies/ReplacementPolicies.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mem/cache/replacement_policies/ReplacementPolicies.py b/src/mem/cache/replacement_policies/ReplacementPolicies.py
index 381f386ed..5737fa450 100644
--- a/src/mem/cache/replacement_policies/ReplacementPolicies.py
+++ b/src/mem/cache/replacement_policies/ReplacementPolicies.py
@@ -40,6 +40,11 @@ class FIFORP(BaseReplacementPolicy):
cxx_class = 'FIFORP'
cxx_header = "mem/cache/replacement_policies/fifo_rp.hh"
+class SecondChanceRP(FIFORP):
+ type = 'SecondChanceRP'
+ cxx_class = 'SecondChanceRP'
+ cxx_header = "mem/cache/replacement_policies/second_chance_rp.hh"
+
class LFURP(BaseReplacementPolicy):
type = 'LFURP'
cxx_class = 'LFURP'