1/*
2 * Copyright (c) 2010-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

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

300
301 // flush and invalidate any existing block
302 CacheBlk *old_blk(tags->findBlock(pkt->getAddr(), pkt->isSecure()));
303 if (old_blk && old_blk->isValid()) {
304 if (old_blk->isDirty() || writebackClean)
305 writebacks.push_back(writebackBlk(old_blk));
306 else
307 writebacks.push_back(cleanEvictBlk(old_blk));
308 tags->invalidate(old_blk);
309 old_blk->invalidate();
308 invalidateBlock(old_blk);
309 }
310
311 blk = nullptr;
312 // lookupLatency is the latency in case the request is uncacheable.
313 lat = lookupLatency;
314 return false;
315 }
316

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

1121 // recvAtomic has finished (but before any successive
1122 // calls), so that the response handling from the fill is
1123 // allowed to happen first
1124 schedule(writebackTempBlockAtomicEvent, curTick());
1125 }
1126
1127 tempBlockWriteback = (blk->isDirty() || writebackClean) ?
1128 writebackBlk(blk) : cleanEvictBlk(blk);
1130 blk->invalidate();
1129 invalidateBlock(blk);
1130 }
1131
1132 if (pkt->needsResponse()) {
1133 pkt->makeAtomicResponse();
1134 }
1135
1136 return lat * clockPeriod();
1137}

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

1525 PacketPtr wcPkt = cleanEvictBlk(blk);
1526 // Check to see if block is cached above. If not allocate
1527 // write buffer
1528 if (isCachedAbove(wcPkt))
1529 delete wcPkt;
1530 else
1531 allocateWriteBuffer(wcPkt, forward_time);
1532 }
1534 blk->invalidate();
1533 invalidateBlock(blk);
1534 }
1535
1536 DPRINTF(CacheVerbose, "%s: Leaving with %s\n", __func__, pkt->print());
1537 delete pkt;
1538}
1539
1540PacketPtr
1541Cache::writebackBlk(CacheBlk *blk)

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

1654Cache::invalidateVisitor(CacheBlk &blk)
1655{
1656
1657 if (blk.isDirty())
1658 warn_once("Invalidating dirty cache lines. Expect things to break.\n");
1659
1660 if (blk.isValid()) {
1661 assert(!blk.isDirty());
1663 tags->invalidate(&blk);
1664 blk.invalidate();
1662 invalidateBlock(&blk);
1663 }
1664
1665 return true;
1666}
1667
1668CacheBlk*
1669Cache::allocateBlock(Addr addr, bool is_secure, PacketList &writebacks)
1670{

--- 1003 unchanged lines hidden ---