summaryrefslogtreecommitdiff
path: root/src/mem/cache/prefetch/stride.hh
diff options
context:
space:
mode:
authorDaniel <odanrc@yahoo.com.br>2018-11-13 20:47:51 +0100
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-11-15 16:52:55 +0000
commit3a3e172b02c108196302a027307eab41626f4d69 (patch)
tree1556c3facd8b72e10eb3bb60cd882841913eb244 /src/mem/cache/prefetch/stride.hh
parent359a2ef70996fb4ed64d09421344eef2e4c85ab1 (diff)
downloadgem5-3a3e172b02c108196302a027307eab41626f4d69.tar.xz
mem-cache: Vectorize StridePrefetcher's entries.
Turn StridePrefetcher::PCTable::entries into a vector of vectors. Change-Id: I2a4589a76eb205910c43723638b7989eddd5ca24 Reviewed-on: https://gem5-review.googlesource.com/c/14357 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/prefetch/stride.hh')
-rw-r--r--src/mem/cache/prefetch/stride.hh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mem/cache/prefetch/stride.hh b/src/mem/cache/prefetch/stride.hh
index 605b5432d..da3bbb33f 100644
--- a/src/mem/cache/prefetch/stride.hh
+++ b/src/mem/cache/prefetch/stride.hh
@@ -50,6 +50,7 @@
#include <string>
#include <unordered_map>
+#include <vector>
#include "base/types.hh"
#include "mem/cache/prefetch/queued.hh"
@@ -90,7 +91,8 @@ class StridePrefetcher : public QueuedPrefetcher
public:
PCTable(int assoc, int sets, const std::string name) :
pcTableAssoc(assoc), pcTableSets(sets), _name(name) {}
- StrideEntry** operator[] (int context) {
+
+ std::vector<std::vector<StrideEntry>>& operator[] (int context) {
auto it = entries.find(context);
if (it != entries.end())
return it->second;
@@ -104,9 +106,9 @@ class StridePrefetcher : public QueuedPrefetcher
const int pcTableAssoc;
const int pcTableSets;
const std::string _name;
- std::unordered_map<int, StrideEntry**> entries;
+ std::unordered_map<int, std::vector<std::vector<StrideEntry>>> entries;
- StrideEntry** allocateNewContext(int context);
+ std::vector<std::vector<StrideEntry>>& allocateNewContext(int context);
};
PCTable pcTable;