From 3aa87251d7bc05a1d99fcb0bded843f1c93c2a77 Mon Sep 17 00:00:00 2001 From: Ali Jafri Date: Fri, 25 Sep 2015 07:26:57 -0400 Subject: 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. --- src/mem/snoop_filter.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mem/snoop_filter.cc') diff --git a/src/mem/snoop_filter.cc b/src/mem/snoop_filter.cc index f6e6ef1b4..9b005cbc5 100755 --- a/src/mem/snoop_filter.cc +++ b/src/mem/snoop_filter.cc @@ -184,6 +184,10 @@ SnoopFilter::lookupSnoop(const Packet* cpkt) auto sf_it = cachedLocations.find(line_addr); bool is_hit = (sf_it != cachedLocations.end()); + panic_if(!is_hit && (cachedLocations.size() >= maxEntryCount), + "snoop filter exceeded capacity of %d cache blocks\n", + maxEntryCount); + // If the snoop filter has no entry and its an uncacheable // request, do not create a new snoop filter entry, simply return // a NULL portlist. -- cgit v1.2.3