cache.cc (13352:75647326f19b) cache.cc (13358:5e1605b47a21)
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

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

172 "Should never see a write in a read-only cache %s\n",
173 name());
174
175 DPRINTF(Cache, "%s for %s\n", __func__, pkt->print());
176
177 // flush and invalidate any existing block
178 CacheBlk *old_blk(tags->findBlock(pkt->getAddr(), pkt->isSecure()));
179 if (old_blk && old_blk->isValid()) {
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

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

172 "Should never see a write in a read-only cache %s\n",
173 name());
174
175 DPRINTF(Cache, "%s for %s\n", __func__, pkt->print());
176
177 // flush and invalidate any existing block
178 CacheBlk *old_blk(tags->findBlock(pkt->getAddr(), pkt->isSecure()));
179 if (old_blk && old_blk->isValid()) {
180 evictBlock(old_blk, writebacks);
180 BaseCache::evictBlock(old_blk, writebacks);
181 }
182
183 blk = nullptr;
184 // lookupLatency is the latency in case the request is uncacheable.
185 lat = lookupLatency;
186 return false;
187 }
188

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

843 PacketPtr pkt = (blk->isDirty() || writebackClean) ?
844 writebackBlk(blk) : cleanEvictBlk(blk);
845
846 invalidateBlock(blk);
847
848 return pkt;
849}
850
181 }
182
183 blk = nullptr;
184 // lookupLatency is the latency in case the request is uncacheable.
185 lat = lookupLatency;
186 return false;
187 }
188

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

843 PacketPtr pkt = (blk->isDirty() || writebackClean) ?
844 writebackBlk(blk) : cleanEvictBlk(blk);
845
846 invalidateBlock(blk);
847
848 return pkt;
849}
850
851void
852Cache::evictBlock(CacheBlk *blk, PacketList &writebacks)
853{
854 PacketPtr pkt = evictBlock(blk);
855 if (pkt) {
856 writebacks.push_back(pkt);
857 }
858}
859
860PacketPtr
861Cache::cleanEvictBlk(CacheBlk *blk)
862{
863 assert(!writebackClean);
864 assert(blk && blk->isValid() && !blk->isDirty());
865
866 // Creating a zero sized write, a message to the snoop filter
867 RequestPtr req = std::make_shared<Request>(

--- 530 unchanged lines hidden ---
851PacketPtr
852Cache::cleanEvictBlk(CacheBlk *blk)
853{
854 assert(!writebackClean);
855 assert(blk && blk->isValid() && !blk->isDirty());
856
857 // Creating a zero sized write, a message to the snoop filter
858 RequestPtr req = std::make_shared<Request>(

--- 530 unchanged lines hidden ---