1/* 2 * Copyright (c) 2010-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 --- 289 unchanged lines hidden (view full) --- 298 DPRINTF(CacheVerbose, "%s for %s\n", __func__, pkt->print()); 299 300 if (pkt->req->isUncacheable()) { 301 DPRINTF(Cache, "uncacheable: %s\n", pkt->print()); 302 303 // flush and invalidate any existing block 304 CacheBlk *old_blk(tags->findBlock(pkt->getAddr(), pkt->isSecure())); 305 if (old_blk && old_blk->isValid()) { |
306 evictBlock(old_blk, writebacks); |
307 } 308 309 blk = nullptr; 310 // lookupLatency is the latency in case the request is uncacheable. 311 lat = lookupLatency; 312 return false; 313 } 314 --- 924 unchanged lines hidden (view full) --- 1239 } else { 1240 // the writeback/clean eviction happens after the call to 1241 // recvAtomic has finished (but before any successive 1242 // calls), so that the response handling from the fill is 1243 // allowed to happen first 1244 schedule(writebackTempBlockAtomicEvent, curTick()); 1245 } 1246 |
1247 tempBlockWriteback = evictBlock(blk); |
1248 } 1249 1250 if (pkt->needsResponse()) { 1251 pkt->makeAtomicResponse(); 1252 } 1253 1254 return lat * clockPeriod(); 1255} --- 376 unchanged lines hidden (view full) --- 1632 clockEdge()); 1633 if (next_pf_time != MaxTick) 1634 schedMemSideSendEvent(next_pf_time); 1635 } 1636 } 1637 1638 // if we used temp block, check to see if its valid and then clear it out 1639 if (blk == tempBlock && tempBlock->isValid()) { |
1640 evictBlock(blk, writebacks); |
1641 } 1642 1643 const Tick forward_time = clockEdge(forwardLatency) + pkt->headerDelay; 1644 // copy writebacks to write buffer 1645 doWritebacks(writebacks, forward_time); 1646 1647 DPRINTF(CacheVerbose, "%s: Leaving with %s\n", __func__, pkt->print()); 1648 delete pkt; 1649} 1650 1651PacketPtr |
1652Cache::evictBlock(CacheBlk *blk) 1653{ 1654 PacketPtr pkt = (blk->isDirty() || writebackClean) ? 1655 writebackBlk(blk) : cleanEvictBlk(blk); 1656 1657 invalidateBlock(blk); 1658 1659 return pkt; 1660} 1661 1662void 1663Cache::evictBlock(CacheBlk *blk, PacketList &writebacks) 1664{ 1665 PacketPtr pkt = evictBlock(blk); 1666 if (pkt) { 1667 writebacks.push_back(pkt); 1668 } 1669} 1670 1671PacketPtr |
1672Cache::writebackBlk(CacheBlk *blk) 1673{ 1674 chatty_assert(!isReadOnly || writebackClean, 1675 "Writeback from read-only cache"); 1676 assert(blk && blk->isValid() && (blk->isDirty() || writebackClean)); 1677 1678 writebacks[Request::wbMasterId]++; 1679 --- 176 unchanged lines hidden (view full) --- 1856 DPRINTF(Cache, "replacement: replacing %#llx (%s) with %#llx " 1857 "(%s): %s\n", repl_addr, blk->isSecure() ? "s" : "ns", 1858 addr, is_secure ? "s" : "ns", 1859 blk->isDirty() ? "writeback" : "clean"); 1860 1861 if (blk->wasPrefetched()) { 1862 unusedPrefetches++; 1863 } |
1864 evictBlock(blk, writebacks); |
1865 replacements++; 1866 } 1867 } 1868 1869 return blk; 1870} 1871 1872void --- 1027 unchanged lines hidden --- |