Deleted Added
sdiff udiff text old ( 12748:ae5ce8e42de7 ) new ( 12749:223c83ed9979 )
full compact
1/*
2 * Copyright (c) 2014-2015 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

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

54{
55
56}
57
58QueuedPrefetcher::~QueuedPrefetcher()
59{
60 // Delete the queued prefetch packets
61 for (DeferredPacket &p : pfq) {
62 delete p.pkt;
63 }
64}
65
66Tick
67QueuedPrefetcher::notify(const PacketPtr &pkt)
68{
69 // Verify this access type is observed by prefetcher
70 if (observeAccess(pkt)) {
71 Addr blk_addr = pkt->getBlockAddr(blkSize);
72 bool is_secure = pkt->isSecure();
73
74 // Squash queued prefetches if demand miss to same line
75 if (queueSquash) {
76 auto itr = pfq.begin();
77 while (itr != pfq.end()) {
78 if (itr->pkt->getAddr() == blk_addr &&
79 itr->pkt->isSecure() == is_secure) {
80 delete itr->pkt;
81 itr = pfq.erase(itr);
82 } else {
83 ++itr;
84 }
85 }
86 }
87

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

217 pfInCache++;
218 DPRINTF(HWPrefetch, "Dropping redundant in "
219 "cache/MSHR prefetch addr:%#x\n", pf_info.first);
220 return nullptr;
221 }
222
223 /* Create a prefetch memory request */
224 RequestPtr pf_req =
225 std::make_shared<Request>(pf_info.first, blkSize, 0, masterId);
226
227 if (is_secure) {
228 pf_req->setFlags(Request::SECURE);
229 }
230 pf_req->taskId(ContextSwitchTaskId::Prefetcher);
231 PacketPtr pf_pkt = new Packet(pf_req, MemCmd::HardPFReq);
232 pf_pkt->allocate();
233

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

248 /* While at the same level of priority */
249 cont = (*prev).priority == (*it).priority;
250 if (cont)
251 /* update pointer */
252 it = prev;
253 }
254 DPRINTF(HWPrefetch, "Prefetch queue full, removing lowest priority "
255 "oldest packet, addr: %#x", it->pkt->getAddr());
256 delete it->pkt;
257 pfq.erase(it);
258 }
259
260 Tick pf_time = curTick() + clockPeriod() * latency;
261 DPRINTF(HWPrefetch, "Prefetch queued. "
262 "addr:%#x priority: %3d tick:%lld.\n",
263 pf_info.first, pf_info.second, pf_time);

--- 18 unchanged lines hidden ---