1/* |
2 * Copyright (c) 2012-2013, 2015-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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 45 unchanged lines hidden (view full) --- 56#include "base/types.hh" 57#include "debug/Cache.hh" 58#include "mem/cache/cache.hh" 59#include "mem/cache/mshr.hh" 60#include "sim/core.hh" 61 62using namespace std; 63 |
64MSHR::MSHR() : downstreamPending(false), |
65 pendingModified(false), 66 postInvalidate(false), postDowngrade(false), |
67 isForward(false), allocOnFill(false) |
68{ 69} 70 |
71MSHR::TargetList::TargetList() 72 : needsWritable(false), hasUpgrade(false) 73{} 74 75 76inline void 77MSHR::TargetList::add(PacketPtr pkt, Tick readyTime, 78 Counter order, Target::Source source, bool markPending) --- 151 unchanged lines hidden (view full) --- 230 downstreamPending = false; 231 assert(targets.isReset()); 232 // Don't know of a case where we would allocate a new MSHR for a 233 // snoop (mem-side request), so set source according to request here 234 Target::Source source = (target->cmd == MemCmd::HardPFReq) ? 235 Target::FromPrefetcher : Target::FromCPU; 236 targets.add(target, when_ready, _order, source, true); 237 assert(deferredTargets.isReset()); |
238} 239 240 241void 242MSHR::clearDownstreamPending() 243{ 244 assert(downstreamPending); 245 downstreamPending = false; 246 // recursively clear flag on any MSHRs we will be forwarding 247 // responses to 248 targets.clearDownstreamPending(); 249} 250 |
251void |
252MSHR::markInService(bool pending_modified_resp) 253{ 254 assert(!inService); |
255 256 inService = true; 257 pendingModified = targets.needsWritable || pending_modified_resp; 258 postInvalidate = postDowngrade = false; 259 260 if (!downstreamPending) { 261 // let upstream caches know that the request has made it to a 262 // level where it's going to get a response 263 targets.clearDownstreamPending(); 264 } |
265} 266 267 268void 269MSHR::deallocate() 270{ 271 assert(targets.empty()); 272 targets.resetFlags(); --- 221 unchanged lines hidden (view full) --- 494 pkt->checkFunctional(this, blkAddr, isSecure, blkSize, NULL); 495 return false; 496 } else { 497 return (targets.checkFunctional(pkt) || 498 deferredTargets.checkFunctional(pkt)); 499 } 500} 501 |
502bool 503MSHR::sendPacket(Cache &cache) 504{ 505 return cache.sendMSHRQueuePacket(this); 506} |
507 508void 509MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const 510{ 511 ccprintf(os, "%s[%#llx:%#llx](%s) %s %s %s state: %s %s %s %s %s\n", 512 prefix, blkAddr, blkAddr + blkSize - 1, 513 isSecure ? "s" : "ns", 514 isForward ? "Forward" : "", 515 allocOnFill ? "AllocOnFill" : "", |
516 needsWritable() ? "Wrtbl" : "", 517 _isUncacheable ? "Unc" : "", 518 inService ? "InSvc" : "", 519 downstreamPending ? "DwnPend" : "", 520 hasPostInvalidate() ? "PostInv" : "", 521 hasPostDowngrade() ? "PostDowngr" : ""); 522 523 ccprintf(os, "%s Targets:\n", prefix); --- 14 unchanged lines hidden --- |