Deleted Added
sdiff udiff text old ( 11275:fc2b0e6550ad ) new ( 11276:3561d002d8c7 )
full compact
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
470
471class ForwardResponseRecord : public Packet::SenderState
472{
473 public:
474
475 ForwardResponseRecord() {}
476};
477
478void
479Cache::doWritebacks(PacketList& writebacks, Tick forward_time)
480{
481 while (!writebacks.empty()) {
482 PacketPtr wbPkt = writebacks.front();
483 // We use forwardLatency here because we are copying writebacks to
484 // write buffer. Call isCachedAbove for both Writebacks and
485 // CleanEvicts. If isCachedAbove returns true we set BLOCK_CACHED flag

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

551
552void
553Cache::recvTimingSnoopResp(PacketPtr pkt)
554{
555 DPRINTF(Cache, "%s for %s addr %#llx size %d\n", __func__,
556 pkt->cmdString(), pkt->getAddr(), pkt->getSize());
557
558 assert(pkt->isResponse());
559
560 // must be cache-to-cache response from upper to lower level
561 ForwardResponseRecord *rec =
562 dynamic_cast<ForwardResponseRecord *>(pkt->senderState);
563 assert(!system->bypassCaches());
564
565 if (rec == NULL) {
566 // @todo What guarantee do we have that this HardPFResp is
567 // actually for this cache, and not a cache closer to the
568 // memory?
569 assert(pkt->cmd == MemCmd::HardPFResp);
570 // Check if it's a prefetch response and handle it. We shouldn't
571 // get any other kinds of responses without FRRs.
572 DPRINTF(Cache, "Got prefetch response from above for addr %#llx (%s)\n",
573 pkt->getAddr(), pkt->isSecure() ? "s" : "ns");
574 recvTimingResp(pkt);
575 return;
576 }
577
578 pkt->popSenderState();
579 delete rec;
580 // forwardLatency is set here because there is a response from an
581 // upper level cache.
582 // To pay the delay that occurs if the packet comes from the bus,
583 // we charge also headerDelay.
584 Tick snoop_resp_time = clockEdge(forwardLatency) + pkt->headerDelay;
585 // Reset the timing of the packet.
586 pkt->headerDelay = pkt->payloadDelay = 0;
587 memSidePort->schedTimingSnoopResp(pkt, snoop_resp_time);

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

1892 bool alreadyResponded = pkt->memInhibitAsserted();
1893 if (is_timing) {
1894 // copy the packet so that we can clear any flags before
1895 // forwarding it upwards, we also allocate data (passing
1896 // the pointer along in case of static data), in case
1897 // there is a snoop hit in upper levels
1898 Packet snoopPkt(pkt, true, true);
1899 snoopPkt.setExpressSnoop();
1900 snoopPkt.pushSenderState(new ForwardResponseRecord());
1901 // the snoop packet does not need to wait any additional
1902 // time
1903 snoopPkt.headerDelay = snoopPkt.payloadDelay = 0;
1904 cpuSidePort->sendTimingSnoopReq(&snoopPkt);
1905
1906 // add the header delay (including crossbar and snoop
1907 // delays) of the upward snoop to the snoop delay for this
1908 // cache
1909 snoop_delay += snoopPkt.headerDelay;
1910
1911 if (snoopPkt.memInhibitAsserted()) {
1912 // cache-to-cache response from some upper cache
1913 assert(!alreadyResponded);
1914 pkt->assertMemInhibit();
1915 } else {
1916 // no cache (or anyone else for that matter) will
1917 // respond, so delete the ForwardResponseRecord here
1918 delete snoopPkt.popSenderState();
1919 }
1920 if (snoopPkt.sharedAsserted()) {
1921 pkt->assertShared();
1922 }
1923 // If this request is a prefetch or clean evict and an upper level
1924 // signals block present, make sure to propagate the block
1925 // presence to the requester.
1926 if (snoopPkt.isBlockCached()) {

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

2345
2346 // It is important to check memInhibitAsserted before
2347 // prefetchSquashed. If another cache has asserted MEM_INGIBIT, it
2348 // will be sending a response which will arrive at the MSHR
2349 // allocated ofr this request. Checking the prefetchSquash first
2350 // may result in the MSHR being prematurely deallocated.
2351
2352 if (snoop_pkt.memInhibitAsserted()) {
2353 // If we are getting a non-shared response it is dirty
2354 bool pending_dirty_resp = !snoop_pkt.sharedAsserted();
2355 markInService(mshr, pending_dirty_resp);
2356 DPRINTF(Cache, "Upward snoop of prefetch for addr"
2357 " %#x (%s) hit\n",
2358 tgt_pkt->getAddr(), tgt_pkt->isSecure()? "s": "ns");
2359 return NULL;
2360 }

--- 294 unchanged lines hidden ---