cache.cc (13564:9bbd53a77887) | cache.cc (13732:43e7199f511f) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2010-2018 ARM Limited | 2 * Copyright (c) 2010-2019 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 770 unchanged lines hidden (view full) --- 781 pkt->payloadDelay; 782 if (pkt->isRead() && !is_error) { 783 // sanity check 784 assert(pkt->getAddr() == tgt_pkt->getAddr()); 785 assert(pkt->getSize() >= tgt_pkt->getSize()); 786 787 tgt_pkt->setData(pkt->getConstPtr<uint8_t>()); 788 } | 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 770 unchanged lines hidden (view full) --- 781 pkt->payloadDelay; 782 if (pkt->isRead() && !is_error) { 783 // sanity check 784 assert(pkt->getAddr() == tgt_pkt->getAddr()); 785 assert(pkt->getSize() >= tgt_pkt->getSize()); 786 787 tgt_pkt->setData(pkt->getConstPtr<uint8_t>()); 788 } |
789 790 // this response did not allocate here and therefore 791 // it was not consumed, make sure that any flags are 792 // carried over to cache above 793 tgt_pkt->copyResponderFlags(pkt); |
|
789 } 790 tgt_pkt->makeTimingResponse(); 791 // if this packet is an error copy that to the new packet 792 if (is_error) 793 tgt_pkt->copyError(pkt); 794 if (tgt_pkt->cmd == MemCmd::ReadResp && 795 (is_invalidate || mshr->hasPostInvalidate())) { 796 // If intermediate cache got ReadRespWithInvalidate, --- 163 unchanged lines hidden (view full) --- 960 name(), pkt->print()); 961 962 uint32_t snoop_delay = 0; 963 964 if (forwardSnoops) { 965 // first propagate snoop upward to see if anyone above us wants to 966 // handle it. save & restore packet src since it will get 967 // rewritten to be relative to cpu-side bus (if any) | 794 } 795 tgt_pkt->makeTimingResponse(); 796 // if this packet is an error copy that to the new packet 797 if (is_error) 798 tgt_pkt->copyError(pkt); 799 if (tgt_pkt->cmd == MemCmd::ReadResp && 800 (is_invalidate || mshr->hasPostInvalidate())) { 801 // If intermediate cache got ReadRespWithInvalidate, --- 163 unchanged lines hidden (view full) --- 965 name(), pkt->print()); 966 967 uint32_t snoop_delay = 0; 968 969 if (forwardSnoops) { 970 // first propagate snoop upward to see if anyone above us wants to 971 // handle it. save & restore packet src since it will get 972 // rewritten to be relative to cpu-side bus (if any) |
968 bool alreadyResponded = pkt->cacheResponding(); | |
969 if (is_timing) { 970 // copy the packet so that we can clear any flags before 971 // forwarding it upwards, we also allocate data (passing 972 // the pointer along in case of static data), in case 973 // there is a snoop hit in upper levels 974 Packet snoopPkt(pkt, true, true); 975 snoopPkt.setExpressSnoop(); 976 // the snoop packet does not need to wait any additional 977 // time 978 snoopPkt.headerDelay = snoopPkt.payloadDelay = 0; 979 cpuSidePort.sendTimingSnoopReq(&snoopPkt); 980 981 // add the header delay (including crossbar and snoop 982 // delays) of the upward snoop to the snoop delay for this 983 // cache 984 snoop_delay += snoopPkt.headerDelay; 985 | 973 if (is_timing) { 974 // copy the packet so that we can clear any flags before 975 // forwarding it upwards, we also allocate data (passing 976 // the pointer along in case of static data), in case 977 // there is a snoop hit in upper levels 978 Packet snoopPkt(pkt, true, true); 979 snoopPkt.setExpressSnoop(); 980 // the snoop packet does not need to wait any additional 981 // time 982 snoopPkt.headerDelay = snoopPkt.payloadDelay = 0; 983 cpuSidePort.sendTimingSnoopReq(&snoopPkt); 984 985 // add the header delay (including crossbar and snoop 986 // delays) of the upward snoop to the snoop delay for this 987 // cache 988 snoop_delay += snoopPkt.headerDelay; 989 |
986 if (snoopPkt.cacheResponding()) { 987 // cache-to-cache response from some upper cache 988 assert(!alreadyResponded); 989 pkt->setCacheResponding(); 990 } 991 // upstream cache has the block, or has an outstanding 992 // MSHR, pass the flag on 993 if (snoopPkt.hasSharers()) { 994 pkt->setHasSharers(); 995 } | |
996 // If this request is a prefetch or clean evict and an upper level 997 // signals block present, make sure to propagate the block 998 // presence to the requester. 999 if (snoopPkt.isBlockCached()) { 1000 pkt->setBlockCached(); 1001 } 1002 // If the request was satisfied by snooping the cache 1003 // above, mark the original packet as satisfied too. 1004 if (snoopPkt.satisfied()) { 1005 pkt->setSatisfied(); 1006 } | 990 // If this request is a prefetch or clean evict and an upper level 991 // signals block present, make sure to propagate the block 992 // presence to the requester. 993 if (snoopPkt.isBlockCached()) { 994 pkt->setBlockCached(); 995 } 996 // If the request was satisfied by snooping the cache 997 // above, mark the original packet as satisfied too. 998 if (snoopPkt.satisfied()) { 999 pkt->setSatisfied(); 1000 } |
1001 1002 // Copy over flags from the snoop response to make sure we 1003 // inform the final destination 1004 pkt->copyResponderFlags(&snoopPkt); |
|
1007 } else { | 1005 } else { |
1006 bool already_responded = pkt->cacheResponding(); |
|
1008 cpuSidePort.sendAtomicSnoop(pkt); | 1007 cpuSidePort.sendAtomicSnoop(pkt); |
1009 if (!alreadyResponded && pkt->cacheResponding()) { | 1008 if (!already_responded && pkt->cacheResponding()) { |
1010 // cache-to-cache response from some upper cache: 1011 // forward response to original requester 1012 assert(pkt->isResponse()); 1013 } 1014 } 1015 } 1016 1017 bool respond = false; --- 385 unchanged lines hidden --- | 1009 // cache-to-cache response from some upper cache: 1010 // forward response to original requester 1011 assert(pkt->isResponse()); 1012 } 1013 } 1014 } 1015 1016 bool respond = false; --- 385 unchanged lines hidden --- |