1/* 2 * Copyright (c) 2010-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 --- 453 unchanged lines hidden (view full) --- 462 // complete miss on store conditional... just give up now 463 pkt->req->setExtraData(0); 464 return true; 465 } 466 467 return false; 468} 469 |
470void 471Cache::doWritebacks(PacketList& writebacks, Tick forward_time) 472{ 473 while (!writebacks.empty()) { 474 PacketPtr wbPkt = writebacks.front(); 475 // We use forwardLatency here because we are copying writebacks to 476 // write buffer. Call isCachedAbove for both Writebacks and 477 // CleanEvicts. If isCachedAbove returns true we set BLOCK_CACHED flag --- 65 unchanged lines hidden (view full) --- 543 544void 545Cache::recvTimingSnoopResp(PacketPtr pkt) 546{ 547 DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__, 548 pkt->cmdString(), pkt->getAddr(), pkt->getSize()); 549 550 assert(pkt->isResponse()); |
551 assert(!system->bypassCaches()); 552 |
553 // determine if the response is from a snoop request we created 554 // (in which case it should be in the outstandingSnoop), or if we 555 // merely forwarded someone else's snoop request 556 const bool forwardAsSnoop = outstandingSnoop.find(pkt->req) == 557 outstandingSnoop.end(); 558 559 if (!forwardAsSnoop) { 560 // the packet came from this cache, so sink it here and do not 561 // forward it |
562 assert(pkt->cmd == MemCmd::HardPFResp); |
563 564 outstandingSnoop.erase(pkt->req); 565 566 DPRINTF(Cache, "Got prefetch response from above for addr " 567 "%#llx (%s)\n", pkt->getAddr(), pkt->isSecure() ? "s" : "ns"); |
568 recvTimingResp(pkt); 569 return; 570 } 571 |
572 // forwardLatency is set here because there is a response from an 573 // upper level cache. 574 // To pay the delay that occurs if the packet comes from the bus, 575 // we charge also headerDelay. 576 Tick snoop_resp_time = clockEdge(forwardLatency) + pkt->headerDelay; 577 // Reset the timing of the packet. 578 pkt->headerDelay = pkt->payloadDelay = 0; 579 memSidePort->schedTimingSnoopResp(pkt, snoop_resp_time); --- 1304 unchanged lines hidden (view full) --- 1884 bool alreadyResponded = pkt->memInhibitAsserted(); 1885 if (is_timing) { 1886 // copy the packet so that we can clear any flags before 1887 // forwarding it upwards, we also allocate data (passing 1888 // the pointer along in case of static data), in case 1889 // there is a snoop hit in upper levels 1890 Packet snoopPkt(pkt, true, true); 1891 snoopPkt.setExpressSnoop(); |
1892 // the snoop packet does not need to wait any additional 1893 // time 1894 snoopPkt.headerDelay = snoopPkt.payloadDelay = 0; 1895 cpuSidePort->sendTimingSnoopReq(&snoopPkt); 1896 1897 // add the header delay (including crossbar and snoop 1898 // delays) of the upward snoop to the snoop delay for this 1899 // cache 1900 snoop_delay += snoopPkt.headerDelay; 1901 1902 if (snoopPkt.memInhibitAsserted()) { 1903 // cache-to-cache response from some upper cache 1904 assert(!alreadyResponded); 1905 pkt->assertMemInhibit(); |
1906 } 1907 if (snoopPkt.sharedAsserted()) { 1908 pkt->assertShared(); 1909 } 1910 // If this request is a prefetch or clean evict and an upper level 1911 // signals block present, make sure to propagate the block 1912 // presence to the requester. 1913 if (snoopPkt.isBlockCached()) { --- 418 unchanged lines hidden (view full) --- 2332 2333 // It is important to check memInhibitAsserted before 2334 // prefetchSquashed. If another cache has asserted MEM_INGIBIT, it 2335 // will be sending a response which will arrive at the MSHR 2336 // allocated ofr this request. Checking the prefetchSquash first 2337 // may result in the MSHR being prematurely deallocated. 2338 2339 if (snoop_pkt.memInhibitAsserted()) { |
2340 auto M5_VAR_USED r = outstandingSnoop.insert(snoop_pkt.req); 2341 assert(r.second); |
2342 // If we are getting a non-shared response it is dirty 2343 bool pending_dirty_resp = !snoop_pkt.sharedAsserted(); 2344 markInService(mshr, pending_dirty_resp); 2345 DPRINTF(Cache, "Upward snoop of prefetch for addr" 2346 " %#x (%s) hit\n", 2347 tgt_pkt->getAddr(), tgt_pkt->isSecure()? "s": "ns"); 2348 return NULL; 2349 } --- 294 unchanged lines hidden --- |