summaryrefslogtreecommitdiff
path: root/src/mem/cache/prefetch/stride.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/cache/prefetch/stride.hh')
-rw-r--r--src/mem/cache/prefetch/stride.hh55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/mem/cache/prefetch/stride.hh b/src/mem/cache/prefetch/stride.hh
index a491eb687..7d8f12110 100644
--- a/src/mem/cache/prefetch/stride.hh
+++ b/src/mem/cache/prefetch/stride.hh
@@ -45,51 +45,54 @@
* Describes a strided prefetcher.
*/
-#ifndef __MEM_CACHE_PREFETCH_STRIDE_PREFETCHER_HH__
-#define __MEM_CACHE_PREFETCH_STRIDE_PREFETCHER_HH__
+#ifndef __MEM_CACHE_PREFETCH_STRIDE_HH__
+#define __MEM_CACHE_PREFETCH_STRIDE_HH__
-#include <climits>
-
-#include "mem/cache/prefetch/base.hh"
+#include "mem/cache/prefetch/queued.hh"
#include "params/StridePrefetcher.hh"
-class StridePrefetcher : public BasePrefetcher
+class StridePrefetcher : public QueuedPrefetcher
{
protected:
+ static const int maxContexts = 64;
+
+ const int maxConf;
+ const int threshConf;
+ const int minConf;
+ const int startConf;
+
+ const int pcTableAssoc;
+ const int pcTableSets;
- static const int Max_Contexts = 64;
+ const bool useMasterId;
- // These constants need to be changed with the type of the
- // 'confidence' field below.
- static const int Max_Conf = INT_MAX;
- static const int Min_Conf = INT_MIN;
+ const int degree;
- class StrideEntry
+ struct StrideEntry
{
- public:
+ StrideEntry() : instAddr(0), lastAddr(0), isSecure(false), stride(0),
+ confidence(0)
+ { }
+
Addr instAddr;
- Addr missAddr;
+ Addr lastAddr;
bool isSecure;
int stride;
int confidence;
- bool tolerance;
};
- std::list<StrideEntry*> table[Max_Contexts];
+ StrideEntry **pcTable[maxContexts];
- bool instTagged;
+ bool pcTableHit(Addr pc, bool is_secure, int master_id, StrideEntry* &entry);
+ StrideEntry* pcTableVictim(Addr pc, int master_id);
+ Addr pcHash(Addr pc) const;
public:
- StridePrefetcher(const Params *p)
- : BasePrefetcher(p), instTagged(p->inst_tagged)
- {
- }
-
- ~StridePrefetcher() {}
+ StridePrefetcher(const StridePrefetcherParams *p);
+ ~StridePrefetcher();
- void calculatePrefetch(PacketPtr &pkt, std::list<Addr> &addresses,
- std::list<Cycles> &delays);
+ void calculatePrefetch(const PacketPtr &pkt, std::vector<Addr> &addresses);
};
-#endif // __MEM_CACHE_PREFETCH_STRIDE_PREFETCHER_HH__
+#endif // __MEM_CACHE_PREFETCH_STRIDE_HH__