queued.cc (12748:ae5ce8e42de7) queued.cc (12749:223c83ed9979)
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) {
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->req;
63 delete p.pkt;
64 }
65}
66
67Tick
68QueuedPrefetcher::notify(const PacketPtr &pkt)
69{
70 // Verify this access type is observed by prefetcher
71 if (observeAccess(pkt)) {
72 Addr blk_addr = pkt->getBlockAddr(blkSize);
73 bool is_secure = pkt->isSecure();
74
75 // Squash queued prefetches if demand miss to same line
76 if (queueSquash) {
77 auto itr = pfq.begin();
78 while (itr != pfq.end()) {
79 if (itr->pkt->getAddr() == blk_addr &&
80 itr->pkt->isSecure() == is_secure) {
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) {
81 delete itr->pkt->req;
82 delete itr->pkt;
83 itr = pfq.erase(itr);
84 } else {
85 ++itr;
86 }
87 }
88 }
89

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

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

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

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

--- 18 unchanged lines hidden ---
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 ---