cache.cc (12724:4f6fac3191d2) | cache.cc (12725:3dcb96899659) |
---|---|
1/* 2 * Copyright (c) 2010-2018 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 --- 257 unchanged lines hidden (view full) --- 266} 267 268 269void 270Cache::recvTimingSnoopResp(PacketPtr pkt) 271{ 272 DPRINTF(Cache, "%s for %s\n", __func__, pkt->print()); 273 | 1/* 2 * Copyright (c) 2010-2018 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 --- 257 unchanged lines hidden (view full) --- 266} 267 268 269void 270Cache::recvTimingSnoopResp(PacketPtr pkt) 271{ 272 DPRINTF(Cache, "%s for %s\n", __func__, pkt->print()); 273 |
274 assert(pkt->isResponse()); 275 assert(!system->bypassCaches()); 276 | |
277 // determine if the response is from a snoop request we created 278 // (in which case it should be in the outstandingSnoop), or if we 279 // merely forwarded someone else's snoop request 280 const bool forwardAsSnoop = outstandingSnoop.find(pkt->req) == 281 outstandingSnoop.end(); 282 283 if (!forwardAsSnoop) { 284 // the packet came from this cache, so sink it here and do not --- 119 unchanged lines hidden (view full) --- 404 BaseCache::handleTimingReqMiss(pkt, mshr, blk, forward_time, request_time); 405} 406 407void 408Cache::recvTimingReq(PacketPtr pkt) 409{ 410 DPRINTF(CacheTags, "%s tags:\n%s\n", __func__, tags->print()); 411 | 274 // determine if the response is from a snoop request we created 275 // (in which case it should be in the outstandingSnoop), or if we 276 // merely forwarded someone else's snoop request 277 const bool forwardAsSnoop = outstandingSnoop.find(pkt->req) == 278 outstandingSnoop.end(); 279 280 if (!forwardAsSnoop) { 281 // the packet came from this cache, so sink it here and do not --- 119 unchanged lines hidden (view full) --- 401 BaseCache::handleTimingReqMiss(pkt, mshr, blk, forward_time, request_time); 402} 403 404void 405Cache::recvTimingReq(PacketPtr pkt) 406{ 407 DPRINTF(CacheTags, "%s tags:\n%s\n", __func__, tags->print()); 408 |
412 assert(pkt->isRequest()); 413 414 // Just forward the packet if caches are disabled. 415 if (system->bypassCaches()) { 416 // @todo This should really enqueue the packet rather 417 bool M5_VAR_USED success = memSidePort.sendTimingReq(pkt); 418 assert(success); 419 return; 420 } 421 | |
422 promoteWholeLineWrites(pkt); 423 424 if (pkt->cacheResponding()) { 425 // a cache above us (but not where the packet came from) is 426 // responding to the request, in other words it has the line 427 // in Modified or Owned state 428 DPRINTF(Cache, "Cache above responding to %s: not responding\n", 429 pkt->print()); --- 230 unchanged lines hidden (view full) --- 660 } 661 662 return latency; 663} 664 665Tick 666Cache::recvAtomic(PacketPtr pkt) 667{ | 409 promoteWholeLineWrites(pkt); 410 411 if (pkt->cacheResponding()) { 412 // a cache above us (but not where the packet came from) is 413 // responding to the request, in other words it has the line 414 // in Modified or Owned state 415 DPRINTF(Cache, "Cache above responding to %s: not responding\n", 416 pkt->print()); --- 230 unchanged lines hidden (view full) --- 647 } 648 649 return latency; 650} 651 652Tick 653Cache::recvAtomic(PacketPtr pkt) 654{ |
668 // Forward the request if the system is in cache bypass mode. 669 if (system->bypassCaches()) 670 return ticksToCycles(memSidePort.sendAtomic(pkt)); 671 | |
672 promoteWholeLineWrites(pkt); 673 674 return BaseCache::recvAtomic(pkt); 675} 676 677 678///////////////////////////////////////////////////// 679// --- 498 unchanged lines hidden (view full) --- 1178} 1179 1180 1181void 1182Cache::recvTimingSnoopReq(PacketPtr pkt) 1183{ 1184 DPRINTF(CacheVerbose, "%s: for %s\n", __func__, pkt->print()); 1185 | 655 promoteWholeLineWrites(pkt); 656 657 return BaseCache::recvAtomic(pkt); 658} 659 660 661///////////////////////////////////////////////////// 662// --- 498 unchanged lines hidden (view full) --- 1161} 1162 1163 1164void 1165Cache::recvTimingSnoopReq(PacketPtr pkt) 1166{ 1167 DPRINTF(CacheVerbose, "%s: for %s\n", __func__, pkt->print()); 1168 |
1186 // Snoops shouldn't happen when bypassing caches 1187 assert(!system->bypassCaches()); 1188 | |
1189 // no need to snoop requests that are not in range 1190 if (!inRange(pkt->getAddr())) { 1191 return; 1192 } 1193 1194 bool is_secure = pkt->isSecure(); 1195 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 1196 --- 107 unchanged lines hidden (view full) --- 1304 // also have the cost of the upwards snoops to account for 1305 pkt->snoopDelay = std::max<uint32_t>(pkt->snoopDelay, snoop_delay + 1306 lookupLatency * clockPeriod()); 1307} 1308 1309Tick 1310Cache::recvAtomicSnoop(PacketPtr pkt) 1311{ | 1169 // no need to snoop requests that are not in range 1170 if (!inRange(pkt->getAddr())) { 1171 return; 1172 } 1173 1174 bool is_secure = pkt->isSecure(); 1175 CacheBlk *blk = tags->findBlock(pkt->getAddr(), is_secure); 1176 --- 107 unchanged lines hidden (view full) --- 1284 // also have the cost of the upwards snoops to account for 1285 pkt->snoopDelay = std::max<uint32_t>(pkt->snoopDelay, snoop_delay + 1286 lookupLatency * clockPeriod()); 1287} 1288 1289Tick 1290Cache::recvAtomicSnoop(PacketPtr pkt) 1291{ |
1312 // Snoops shouldn't happen when bypassing caches 1313 assert(!system->bypassCaches()); 1314 | |
1315 // no need to snoop requests that are not in range. 1316 if (!inRange(pkt->getAddr())) { 1317 return 0; 1318 } 1319 1320 CacheBlk *blk = tags->findBlock(pkt->getAddr(), pkt->isSecure()); 1321 uint32_t snoop_delay = handleSnoop(pkt, blk, false, false, false); 1322 return snoop_delay + lookupLatency * clockPeriod(); --- 117 unchanged lines hidden --- | 1292 // no need to snoop requests that are not in range. 1293 if (!inRange(pkt->getAddr())) { 1294 return 0; 1295 } 1296 1297 CacheBlk *blk = tags->findBlock(pkt->getAddr(), pkt->isSecure()); 1298 uint32_t snoop_delay = handleSnoop(pkt, blk, false, false, false); 1299 return snoop_delay + lookupLatency * clockPeriod(); --- 117 unchanged lines hidden --- |