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
commit6ac356f93b897c8a80378f114865240cba96b693 (patch)
tree8207ecd8c01334562136285be7d64ab7ef9455f6 /src/mem/snoop_filter.hh
parent79d3dbcea82cf2197920981999ad458ed3a34690 (diff)
downloadgem5-6ac356f93b897c8a80378f114865240cba96b693.tar.xz
mem: Add CleanEvict and Writeback support to snoop filters
This patch adds the functionality to properly track CleanEvicts and Writebacks in the snoop filter. Previously there were no CleanEvicts, and Writebacks did not send up snoops to ensure there were no copies in caches above. Hence a writeback could never erase an entry from the snoop filter. When a CleanEvict message reaches a snoop filter, it confirms that the BLOCK_CACHED flag is not set and resets the bits corresponding to the CleanEvict address and port it arrived on. If none of the other peer caches have (or have requested) the block, the snoop filter forwards the CleanEvict to lower levels of memory. In case of a Writeback message, the snoop filter checks if the BLOCK_CACHED flag is not set and only then resets the bits corresponding to the Writeback address. If any of the other peer caches have (or has requested) the same block, the snoop filter sets the BLOCK_CACHED flag in the Writeback before forwarding it to lower levels of memory heirarachy.
Diffstat (limited to 'src/mem/snoop_filter.hh')
-rwxr-xr-xsrc/mem/snoop_filter.hh20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mem/snoop_filter.hh b/src/mem/snoop_filter.hh
index 1e7add660..ee2c82b6e 100755
--- a/src/mem/snoop_filter.hh
+++ b/src/mem/snoop_filter.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 ARM Limited
+ * Copyright (c) 2013-2015 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -203,6 +203,11 @@ class SnoopFilter : public SimObject {
SnoopMask holder;
};
/**
+ * HashMap of SnoopItems indexed by line address
+ */
+ typedef m5::hash_map<Addr, SnoopItem> SnoopFilterCache;
+
+ /**
* Convert a single port to a corresponding, one-hot bitmask
* @param port SlavePort that should be converted.
* @return One-hot bitmask corresponding to the port.
@@ -222,8 +227,19 @@ class SnoopFilter : public SimObject {
SnoopList maskToPortList(SnoopMask ports) const;
private:
+
+ /**
+ * Removes snoop filter items which have no requesters and no holders.
+ */
+ void eraseIfNullEntry(SnoopFilterCache::iterator& sf_it);
/** Simple hash set of cached addresses. */
- m5::hash_map<Addr, SnoopItem> cachedLocations;
+ SnoopFilterCache cachedLocations;
+ /**
+ * Variable to temporarily store value of snoopfilter entry
+ * incase updateRequest needs to undo changes made in lookupRequest
+ * (because of crossbar retry)
+ */
+ SnoopItem retryItem;
/** List of all attached slave ports. */
SnoopList slavePorts;
/** Cache line size. */