stride.cc (11321:02e930db812d) stride.cc (11439:d0368996f1e0)
1/*
2 * Copyright (c) 2012-2013, 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

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

93 delete[] entry.second[s];
94 }
95 delete[] entry.second;
96 }
97}
98
99void
100StridePrefetcher::calculatePrefetch(const PacketPtr &pkt,
1/*
2 * Copyright (c) 2012-2013, 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

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

93 delete[] entry.second[s];
94 }
95 delete[] entry.second;
96 }
97}
98
99void
100StridePrefetcher::calculatePrefetch(const PacketPtr &pkt,
101 std::vector &addresses)
101 std::vector<AddrPriority> &addresses)
102{
103 if (!pkt->req->hasPC()) {
104 DPRINTF(HWPrefetch, "Ignoring request with no PC.\n");
105 return;
106 }
107
108 // Get required packet info
109 Addr pkt_addr = pkt->getAddr();

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

148 int prefetch_stride = new_stride;
149 if (abs(new_stride) < blkSize) {
150 prefetch_stride = (new_stride < 0) ? -blkSize : blkSize;
151 }
152
153 Addr new_addr = pkt_addr + d * prefetch_stride;
154 if (samePage(pkt_addr, new_addr)) {
155 DPRINTF(HWPrefetch, "Queuing prefetch to %#x.\n", new_addr);
102{
103 if (!pkt->req->hasPC()) {
104 DPRINTF(HWPrefetch, "Ignoring request with no PC.\n");
105 return;
106 }
107
108 // Get required packet info
109 Addr pkt_addr = pkt->getAddr();

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

148 int prefetch_stride = new_stride;
149 if (abs(new_stride) < blkSize) {
150 prefetch_stride = (new_stride < 0) ? -blkSize : blkSize;
151 }
152
153 Addr new_addr = pkt_addr + d * prefetch_stride;
154 if (samePage(pkt_addr, new_addr)) {
155 DPRINTF(HWPrefetch, "Queuing prefetch to %#x.\n", new_addr);
156 addresses.push_back(new_addr);
156 addresses.push_back(AddrPriority(new_addr, 0));
157 } else {
158 // Record the number of page crossing prefetches generated
159 pfSpanPage += degree - d + 1;
160 DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
161 return;
162 }
163 }
164 } else {

--- 55 unchanged lines hidden ---
157 } else {
158 // Record the number of page crossing prefetches generated
159 pfSpanPage += degree - d + 1;
160 DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
161 return;
162 }
163 }
164 } else {

--- 55 unchanged lines hidden ---