59c59,63
< SnoopItem& sf_item = cachedLocations[line_addr];
---
> auto sf_it = cachedLocations.find(line_addr);
> bool is_hit = (sf_it != cachedLocations.end());
> // Create a new element through operator[] and modify in-place
> SnoopItem& sf_item = is_hit ? sf_it->second : cachedLocations[line_addr];
> SnoopMask interested = sf_item.holder | sf_item.requested;
60a65,73
> totRequests++;
> if (is_hit) {
> // Single bit set -> value is a power of two
> if (isPow2(interested))
> hitSingleRequests++;
> else
> hitMultiRequests++;
> }
>
84,85c97
< SnoopMask interested = (sf_item.holder | sf_item.requested) & ~req_port;
< return snoopSelected(maskToPortList(interested), lookupLatency);
---
> return snoopSelected(maskToPortList(interested & ~req_port), lookupLatency);
144c156,159
< SnoopItem& sf_item = cachedLocations[line_addr];
---
> auto sf_it = cachedLocations.find(line_addr);
> bool is_hit = (sf_it != cachedLocations.end());
> // Create a new element through operator[] and modify in-place
> SnoopItem& sf_item = is_hit ? sf_it->second : cachedLocations[line_addr];
149a165,174
>
> totSnoops++;
> if (is_hit) {
> // Single bit set -> value is a power of two
> if (isPow2(interested))
> hitSingleSnoops++;
> else
> hitMultiSnoops++;
> }
>
269a295,326
> void
> SnoopFilter::regStats()
> {
> totRequests
> .name(name() + ".tot_requests")
> .desc("Total number of requests made to the snoop filter.");
>
> hitSingleRequests
> .name(name() + ".hit_single_requests")
> .desc("Number of requests hitting in the snoop filter with a single "\
> "holder of the requested data.");
>
> hitMultiRequests
> .name(name() + ".hit_multi_requests")
> .desc("Number of requests hitting in the snoop filter with multiple "\
> "(>1) holders of the requested data.");
>
> totSnoops
> .name(name() + ".tot_snoops")
> .desc("Total number of snoops made to the snoop filter.");
>
> hitSingleSnoops
> .name(name() + ".hit_single_snoops")
> .desc("Number of snoops hitting in the snoop filter with a single "\
> "holder of the requested data.");
>
> hitMultiSnoops
> .name(name() + ".hit_multi_snoops")
> .desc("Number of snoops hitting in the snoop filter with multiple "\
> "(>1) holders of the requested data.");
> }
>