summaryrefslogtreecommitdiff
path: root/src/mem/snoop_filter.hh
diff options
context:
space:
mode:
authorAli Jafri <ali.jafri@arm.com>2015-09-25 07:26:57 -0400
committerAli Jafri <ali.jafri@arm.com>2015-09-25 07:26:57 -0400
commit3aa87251d7bc05a1d99fcb0bded843f1c93c2a77 (patch)
tree8d29aaba6c4cb41bd29d122142eb31efc471432a /src/mem/snoop_filter.hh
parent0c5a98f9d18c6fdae287b1b608d1ffb1c13fb9c9 (diff)
downloadgem5-3aa87251d7bc05a1d99fcb0bded843f1c93c2a77.tar.xz
mem: Add snoop filters to L2 crossbars, and check size
This patch adds a snoop filter to the L2XBar. For now we refrain from globally adding a snoop filter to the SystemXBar, since the latter is also used in systems without caches. In scenarios without caches the snoop filter will not see any writeback/clean evicts from the CPU ports, despite the fact that they are snooping. To avoid inadvertent use of the snoop filter in these cases we leave it out for now. A size check is added to the snoop filter, merely to ensure it does not grow beyond the total capacity of the caches above it. The size has to be set manually, and a value of 8 MByte is choosen as suitably high default.
Diffstat (limited to 'src/mem/snoop_filter.hh')
-rwxr-xr-xsrc/mem/snoop_filter.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mem/snoop_filter.hh b/src/mem/snoop_filter.hh
index b1e33dc8f..be3018e6e 100755
--- a/src/mem/snoop_filter.hh
+++ b/src/mem/snoop_filter.hh
@@ -90,7 +90,8 @@ class SnoopFilter : public SimObject {
SnoopFilter (const SnoopFilterParams *p) :
SimObject(p), reqLookupResult(cachedLocations.end()), retryItem{0, 0},
- linesize(p->system->cacheLineSize()), lookupLatency(p->lookup_latency)
+ linesize(p->system->cacheLineSize()), lookupLatency(p->lookup_latency),
+ maxEntryCount(p->max_capacity / p->system->cacheLineSize())
{
}
@@ -254,6 +255,8 @@ class SnoopFilter : public SimObject {
const unsigned linesize;
/** Latency for doing a lookup in the filter */
const Cycles lookupLatency;
+ /** Max capacity in terms of cache blocks tracked, for sanity checking */
+ const unsigned maxEntryCount;
/** Statistics */
Stats::Scalar totRequests;