1/* 2 * Copyright (c) 2013-2016 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 --- 55 unchanged lines hidden (view full) --- 64{ 65 DPRINTF(SnoopFilter, "%s: packet src %s addr 0x%x cmd %s\n", 66 __func__, slave_port.name(), cpkt->getAddr(), cpkt->cmdString()); 67 68 // check if the packet came from a cache 69 bool allocate = !cpkt->req->isUncacheable() && slave_port.isSnooping() && 70 cpkt->fromCache(); 71 Addr line_addr = cpkt->getBlockAddr(linesize); |
72 if (cpkt->isSecure()) { 73 line_addr |= LineSecure; 74 } |
75 SnoopMask req_port = portToMask(slave_port); 76 reqLookupResult = cachedLocations.find(line_addr); 77 bool is_hit = (reqLookupResult != cachedLocations.end()); 78 79 // If the snoop filter has no entry, and we should not allocate, 80 // do not create a new snoop filter entry, simply return a NULL 81 // portlist. 82 if (!is_hit && !allocate) --- 61 unchanged lines hidden (view full) --- 144 __func__, sf_item.requested, sf_item.holder); 145 } 146 } 147 148 return snoopSelected(maskToPortList(interested & ~req_port), lookupLatency); 149} 150 151void |
152SnoopFilter::finishRequest(bool will_retry, Addr addr, bool is_secure) |
153{ 154 if (reqLookupResult != cachedLocations.end()) { 155 // since we rely on the caller, do a basic check to ensure 156 // that finishRequest is being called following lookupRequest |
157 Addr line_addr = (addr & ~(Addr(linesize - 1))); 158 if (is_secure) { 159 line_addr |= LineSecure; 160 } 161 assert(reqLookupResult->first == line_addr); |
162 if (will_retry) { 163 // Undo any changes made in lookupRequest to the snoop filter 164 // entry if the request will come again. retryItem holds 165 // the previous value of the snoopfilter entry. 166 reqLookupResult->second = retryItem; 167 168 DPRINTF(SnoopFilter, "%s: restored SF value %x.%x\n", 169 __func__, retryItem.requested, retryItem.holder); --- 7 unchanged lines hidden (view full) --- 177SnoopFilter::lookupSnoop(const Packet* cpkt) 178{ 179 DPRINTF(SnoopFilter, "%s: packet addr 0x%x cmd %s\n", 180 __func__, cpkt->getAddr(), cpkt->cmdString()); 181 182 assert(cpkt->isRequest()); 183 184 Addr line_addr = cpkt->getBlockAddr(linesize); |
185 if (cpkt->isSecure()) { 186 line_addr |= LineSecure; 187 } |
188 auto sf_it = cachedLocations.find(line_addr); 189 bool is_hit = (sf_it != cachedLocations.end()); 190 191 panic_if(!is_hit && (cachedLocations.size() >= maxEntryCount), 192 "snoop filter exceeded capacity of %d cache blocks\n", 193 maxEntryCount); 194 195 // If the snoop filter has no entry, simply return a NULL --- 52 unchanged lines hidden (view full) --- 248 // if this snoop response is due to an uncacheable request, or is 249 // being turned into a normal response, there is nothing more to 250 // do 251 if (cpkt->req->isUncacheable() || !req_port.isSnooping()) { 252 return; 253 } 254 255 Addr line_addr = cpkt->getBlockAddr(linesize); |
256 if (cpkt->isSecure()) { 257 line_addr |= LineSecure; 258 } |
259 SnoopMask rsp_mask = portToMask(rsp_port); 260 SnoopMask req_mask = portToMask(req_port); 261 SnoopItem& sf_item = cachedLocations[line_addr]; 262 263 DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n", 264 __func__, sf_item.requested, sf_item.holder); 265 266 // The source should have the line --- 30 unchanged lines hidden (view full) --- 297 DPRINTF(SnoopFilter, "%s: packet rsp %s req %s addr 0x%x cmd %s\n", 298 __func__, rsp_port.name(), req_port.name(), cpkt->getAddr(), 299 cpkt->cmdString()); 300 301 assert(cpkt->isResponse()); 302 assert(cpkt->cacheResponding()); 303 304 Addr line_addr = cpkt->getBlockAddr(linesize); |
305 if (cpkt->isSecure()) { 306 line_addr |= LineSecure; 307 } |
308 auto sf_it = cachedLocations.find(line_addr); 309 bool is_hit = sf_it != cachedLocations.end(); 310 311 // Nothing to do if it is not a hit 312 if (!is_hit) 313 return; 314 315 SnoopItem& sf_item = sf_it->second; --- 23 unchanged lines hidden (view full) --- 339 340 // we only allocate if the packet actually came from a cache, but 341 // start by checking if the port is snooping 342 if (cpkt->req->isUncacheable() || !slave_port.isSnooping()) 343 return; 344 345 // next check if we actually allocated an entry 346 Addr line_addr = cpkt->getBlockAddr(linesize); |
347 if (cpkt->isSecure()) { 348 line_addr |= LineSecure; 349 } |
350 auto sf_it = cachedLocations.find(line_addr); 351 if (sf_it == cachedLocations.end()) 352 return; 353 354 SnoopMask slave_mask = portToMask(slave_port); 355 SnoopItem& sf_item = sf_it->second; 356 357 DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n", --- 57 unchanged lines hidden --- |