snoop_filter.hh (10888:85a001f2193b) snoop_filter.hh (11129:48c02e8b0bbb)
1/*
1/*
2 * Copyright (c) 2013 ARM Limited
2 * Copyright (c) 2013-2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 187 unchanged lines hidden (view full) ---

198 * outstanding request to this line (requested) or already share a cache line
199 * with this address (holder).
200 */
201 struct SnoopItem {
202 SnoopMask requested;
203 SnoopMask holder;
204 };
205 /**
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 187 unchanged lines hidden (view full) ---

198 * outstanding request to this line (requested) or already share a cache line
199 * with this address (holder).
200 */
201 struct SnoopItem {
202 SnoopMask requested;
203 SnoopMask holder;
204 };
205 /**
206 * HashMap of SnoopItems indexed by line address
207 */
208 typedef m5::hash_map<Addr, SnoopItem> SnoopFilterCache;
209
210 /**
206 * Convert a single port to a corresponding, one-hot bitmask
207 * @param port SlavePort that should be converted.
208 * @return One-hot bitmask corresponding to the port.
209 */
210 SnoopMask portToMask(const SlavePort& port) const;
211 /**
212 * Convert multiple ports to a corresponding bitmask
213 * @param ports SnoopList that should be converted.
214 * @return Bitmask corresponding to the ports in the list.
215 */
216 SnoopMask portListToMask(const SnoopList& ports) const;
217 /**
218 * Converts a bitmask of ports into the corresponing list of ports
219 * @param ports SnoopMask of the requested ports
220 * @return SnoopList containing all the requested SlavePorts
221 */
222 SnoopList maskToPortList(SnoopMask ports) const;
223
224 private:
211 * Convert a single port to a corresponding, one-hot bitmask
212 * @param port SlavePort that should be converted.
213 * @return One-hot bitmask corresponding to the port.
214 */
215 SnoopMask portToMask(const SlavePort& port) const;
216 /**
217 * Convert multiple ports to a corresponding bitmask
218 * @param ports SnoopList that should be converted.
219 * @return Bitmask corresponding to the ports in the list.
220 */
221 SnoopMask portListToMask(const SnoopList& ports) const;
222 /**
223 * Converts a bitmask of ports into the corresponing list of ports
224 * @param ports SnoopMask of the requested ports
225 * @return SnoopList containing all the requested SlavePorts
226 */
227 SnoopList maskToPortList(SnoopMask ports) const;
228
229 private:
230
231 /**
232 * Removes snoop filter items which have no requesters and no holders.
233 */
234 void eraseIfNullEntry(SnoopFilterCache::iterator& sf_it);
225 /** Simple hash set of cached addresses. */
235 /** Simple hash set of cached addresses. */
226 m5::hash_map<Addr, SnoopItem> cachedLocations;
236 SnoopFilterCache cachedLocations;
237 /**
238 * Variable to temporarily store value of snoopfilter entry
239 * incase updateRequest needs to undo changes made in lookupRequest
240 * (because of crossbar retry)
241 */
242 SnoopItem retryItem;
227 /** List of all attached slave ports. */
228 SnoopList slavePorts;
229 /** Cache line size. */
230 const unsigned linesize;
231 /** Latency for doing a lookup in the filter */
232 const Cycles lookupLatency;
233
234 /** Statistics */

--- 38 unchanged lines hidden ---
243 /** List of all attached slave ports. */
244 SnoopList slavePorts;
245 /** Cache line size. */
246 const unsigned linesize;
247 /** Latency for doing a lookup in the filter */
248 const Cycles lookupLatency;
249
250 /** Statistics */

--- 38 unchanged lines hidden ---