diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-02-02 17:34:40 +0000 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2018-05-31 15:12:04 +0000 |
commit | 41db9b95aa234094da62fdd3a863870b175d8f97 (patch) | |
tree | 433ad327b0e148bbacc65e1fcfdb87e41f1c4cb4 /src/mem/cache/Cache.py | |
parent | d5c4dd986a48f13cc774e487993634d8c2b68e10 (diff) | |
download | gem5-41db9b95aa234094da62fdd3a863870b175d8f97.tar.xz |
mem-cache: Adopt a more sensible cache class hierarchy
This patch changes what goes into the BaseCache and what goes into the
Cache, to make it easier to add a NoncoherentCache with as much re-use
as possible. A number of redundant members and definitions are also
removed in the process.
This is a modified version of a changeset put together by Andreas
Hansson <andreas.hansson@arm.com>
Change-Id: Ie9dd73c4ec07732e778e7416b712dad8b4bd5d4b
Reviewed-on: https://gem5-review.googlesource.com/10431
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/Cache.py')
-rw-r--r-- | src/mem/cache/Cache.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mem/cache/Cache.py b/src/mem/cache/Cache.py index faee0925b..a2fa4e90f 100644 --- a/src/mem/cache/Cache.py +++ b/src/mem/cache/Cache.py @@ -46,6 +46,12 @@ from Prefetcher import BasePrefetcher from ReplacementPolicies import * from Tags import * + +# Enum for cache clusivity, currently mostly inclusive or mostly +# exclusive. +class Clusivity(Enum): vals = ['mostly_incl', 'mostly_excl'] + + class BaseCache(MemObject): type = 'BaseCache' abstract = True @@ -90,13 +96,13 @@ class BaseCache(MemObject): system = Param.System(Parent.any, "System we belong to") -# Enum for cache clusivity, currently mostly inclusive or mostly -# exclusive. -class Clusivity(Enum): vals = ['mostly_incl', 'mostly_excl'] - -class Cache(BaseCache): - type = 'Cache' - cxx_header = 'mem/cache/cache.hh' + # Determine if this cache sends out writebacks for clean lines, or + # simply clean evicts. In cases where a downstream cache is mostly + # exclusive with respect to this cache (acting as a victim cache), + # the clean writebacks are essential for performance. In general + # this should be set to True for anything but the last-level + # cache. + writeback_clean = Param.Bool(False, "Writeback clean lines") # Control whether this cache should be mostly inclusive or mostly # exclusive with respect to upstream caches. The behaviour on a @@ -110,10 +116,7 @@ class Cache(BaseCache): clusivity = Param.Clusivity('mostly_incl', "Clusivity with upstream cache") - # Determine if this cache sends out writebacks for clean lines, or - # simply clean evicts. In cases where a downstream cache is mostly - # exclusive with respect to this cache (acting as a victim cache), - # the clean writebacks are essential for performance. In general - # this should be set to True for anything but the last-level - # cache. - writeback_clean = Param.Bool(False, "Writeback clean lines") + +class Cache(BaseCache): + type = 'Cache' + cxx_header = 'mem/cache/cache.hh' |