Deleted Added
sdiff udiff text old ( 12823:ba630bc7a36d ) new ( 13349:20890038e8a0 )
full compact
1/*
2 * Copyright (c) 2012-2013, 2015-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

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

35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * Authors: Erik Hallnor
42 * Dave Greene
43 */
44
45/**
46 * @file
47 * Miss Status and Handling Register (MSHR) definitions.
48 */
49
50#include "mem/cache/mshr.hh"

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

58#include "debug/Cache.hh"
59#include "mem/cache/base.hh"
60#include "mem/request.hh"
61#include "sim/core.hh"
62
63MSHR::MSHR() : downstreamPending(false),
64 pendingModified(false),
65 postInvalidate(false), postDowngrade(false),
66 isForward(false)
67{
68}
69
70MSHR::TargetList::TargetList()
71 : needsWritable(false), hasUpgrade(false), allocOnFill(false),
72 hasFromCache(false)
73{}
74

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

90 }
91
92 // potentially re-evaluate whether we should allocate on a fill or
93 // not
94 allocOnFill = allocOnFill || alloc_on_fill;
95
96 if (source != Target::FromPrefetcher) {
97 hasFromCache = hasFromCache || pkt->fromCache();
98 }
99 }
100}
101
102void
103MSHR::TargetList::populateFlags()
104{
105 resetFlags();

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

252{
253 blkAddr = blk_addr;
254 blkSize = blk_size;
255 isSecure = target->isSecure();
256 readyTime = when_ready;
257 order = _order;
258 assert(target);
259 isForward = false;
260 _isUncacheable = target->req->isUncacheable();
261 inService = false;
262 downstreamPending = false;
263 assert(targets.isReset());
264 // Don't know of a case where we would allocate a new MSHR for a
265 // snoop (mem-side request), so set source according to request here
266 Target::Source source = (target->cmd == MemCmd::HardPFReq) ?
267 Target::FromPrefetcher : Target::FromCPU;
268 targets.add(target, when_ready, _order, source, true, alloc_on_fill);
269 assert(deferredTargets.isReset());
270}
271
272
273void
274MSHR::clearDownstreamPending()
275{
276 assert(downstreamPending);
277 downstreamPending = false;

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

289 pendingModified = targets.needsWritable || pending_modified_resp;
290 postInvalidate = postDowngrade = false;
291
292 if (!downstreamPending) {
293 // let upstream caches know that the request has made it to a
294 // level where it's going to get a response
295 targets.clearDownstreamPending();
296 }
297}
298
299
300void
301MSHR::deallocate()
302{
303 assert(targets.empty());
304 targets.resetFlags();

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

475
476 return true;
477}
478
479MSHR::TargetList
480MSHR::extractServiceableTargets(PacketPtr pkt)
481{
482 TargetList ready_targets;
483 // If the downstream MSHR got an invalidation request then we only
484 // service the first of the FromCPU targets and any other
485 // non-FromCPU target. This way the remaining FromCPU targets
486 // issue a new request and get a fresh copy of the block and we
487 // avoid memory consistency violations.
488 if (pkt->cmd == MemCmd::ReadRespWithInvalidate) {
489 auto it = targets.begin();
490 assert((it->source == Target::FromCPU) ||

--- 183 unchanged lines hidden ---