mem: Change prefetcher to use random_mt
Prefechers has used rand() to generate random numers previously.
This commit is contained in:
parent
516e6046ae
commit
b2342c5d9a
1 changed files with 2 additions and 1 deletions
3
src/mem/cache/prefetch/stride.cc
vendored
3
src/mem/cache/prefetch/stride.cc
vendored
|
@ -46,6 +46,7 @@
|
||||||
* Stride Prefetcher template instantiations.
|
* Stride Prefetcher template instantiations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "base/random.hh"
|
||||||
#include "debug/HWPrefetch.hh"
|
#include "debug/HWPrefetch.hh"
|
||||||
#include "mem/cache/prefetch/stride.hh"
|
#include "mem/cache/prefetch/stride.hh"
|
||||||
|
|
||||||
|
@ -176,7 +177,7 @@ StridePrefetcher::pcTableVictim(Addr pc, int master_id)
|
||||||
{
|
{
|
||||||
// Rand replacement for now
|
// Rand replacement for now
|
||||||
int set = pcHash(pc);
|
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);
|
DPRINTF(HWPrefetch, "Victimizing lookup table[%d][%d].\n", set, way);
|
||||||
return &pcTable[master_id][set][way];
|
return &pcTable[master_id][set][way];
|
||||||
|
|
Loading…
Reference in a new issue