summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-12-23 09:31:19 -0500
committerMitch Hayenga <mitch.hayenga@arm.com>2014-12-23 09:31:19 -0500
commitb2342c5d9aea0b732f6d5a5b6c9c3961940ed8e7 (patch)
tree184666d410aa4c230540a05aedb8af29819ac0e8
parent516e6046aefd486768d03ba9c58db80e5ad3fff0 (diff)
downloadgem5-b2342c5d9aea0b732f6d5a5b6c9c3961940ed8e7.tar.xz
mem: Change prefetcher to use random_mt
Prefechers has used rand() to generate random numers previously.
-rw-r--r--src/mem/cache/prefetch/stride.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mem/cache/prefetch/stride.cc b/src/mem/cache/prefetch/stride.cc
index 3ff7acda0..74c84b94f 100644
--- a/src/mem/cache/prefetch/stride.cc
+++ b/src/mem/cache/prefetch/stride.cc
@@ -46,6 +46,7 @@
* Stride Prefetcher template instantiations.
*/
+#include "base/random.hh"
#include "debug/HWPrefetch.hh"
#include "mem/cache/prefetch/stride.hh"
@@ -176,7 +177,7 @@ StridePrefetcher::pcTableVictim(Addr pc, int master_id)
{
// Rand replacement for now
int set = pcHash(pc);
- int way = rand() % pcTableAssoc;
+ int way = random_mt.random<int>(0, pcTableAssoc - 1);
DPRINTF(HWPrefetch, "Victimizing lookup table[%d][%d].\n", set, way);
return &pcTable[master_id][set][way];