summaryrefslogtreecommitdiff
path: root/src/mem/cache/prefetch/tagged.cc
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-12-23 09:31:18 -0500
committerMitch Hayenga <mitch.hayenga@arm.com>2014-12-23 09:31:18 -0500
commitdf82a2d00311b96ec7fefc901232ba01bbf26d39 (patch)
treeef7d4ac6cc316d9a67eada5df423d32cef97173d /src/mem/cache/prefetch/tagged.cc
parent6cb58b2bd2ffd19a667e3b9473ff4a0ccfd14c81 (diff)
downloadgem5-df82a2d00311b96ec7fefc901232ba01bbf26d39.tar.xz
mem: Rework the structuring of the prefetchers
Re-organizes the prefetcher class structure. Previously the BasePrefetcher forced multiple assumptions on the prefetchers that inherited from it. This patch makes the BasePrefetcher class truly representative of base functionality. For example, the base class no longer enforces FIFO order. Instead, prefetchers with FIFO requests (like the existing stride and tagged prefetchers) now inherit from a new QueuedPrefetcher base class. Finally, the stride-based prefetcher now assumes a custimizable lookup table (sets/ways) rather than the previous fully associative structure.
Diffstat (limited to 'src/mem/cache/prefetch/tagged.cc')
-rw-r--r--src/mem/cache/prefetch/tagged.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mem/cache/prefetch/tagged.cc b/src/mem/cache/prefetch/tagged.cc
index f34b28b14..59c489a28 100644
--- a/src/mem/cache/prefetch/tagged.cc
+++ b/src/mem/cache/prefetch/tagged.cc
@@ -35,32 +35,30 @@
#include "mem/cache/prefetch/tagged.hh"
-TaggedPrefetcher::TaggedPrefetcher(const Params *p)
- : BasePrefetcher(p)
+TaggedPrefetcher::TaggedPrefetcher(const TaggedPrefetcherParams *p)
+ : QueuedPrefetcher(p), degree(p->degree)
{
+
}
void
-TaggedPrefetcher::
-calculatePrefetch(PacketPtr &pkt, std::list<Addr> &addresses,
- std::list<Cycles> &delays)
+TaggedPrefetcher::calculatePrefetch(const PacketPtr &pkt,
+ std::vector<Addr> &addresses)
{
Addr blkAddr = pkt->getAddr() & ~(Addr)(blkSize-1);
for (int d = 1; d <= degree; d++) {
Addr newAddr = blkAddr + d*(blkSize);
- if (pageStop && !samePage(blkAddr, newAddr)) {
- // Spanned the page, so now stop
+ if (!samePage(blkAddr, newAddr)) {
+ // Count number of unissued prefetches due to page crossing
pfSpanPage += degree - d + 1;
return;
} else {
addresses.push_back(newAddr);
- delays.push_back(latency);
}
}
}
-
TaggedPrefetcher*
TaggedPrefetcherParams::create()
{