stride.cc (10623:b9646f4546ad) stride.cc (10627:63edd4a1243f)
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 32 unchanged lines hidden (view full) ---

41 * Steve Reinhardt
42 */
43
44/**
45 * @file
46 * Stride Prefetcher template instantiations.
47 */
48
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 32 unchanged lines hidden (view full) ---

41 * Steve Reinhardt
42 */
43
44/**
45 * @file
46 * Stride Prefetcher template instantiations.
47 */
48
49#include "base/random.hh"
49#include "debug/HWPrefetch.hh"
50#include "mem/cache/prefetch/stride.hh"
51
52StridePrefetcher::StridePrefetcher(const StridePrefetcherParams *p)
53 : QueuedPrefetcher(p),
54 maxConf(p->max_conf),
55 threshConf(p->thresh_conf),
56 minConf(p->min_conf),

--- 114 unchanged lines hidden (view full) ---

171 return (hash1 ^ hash2) & (Addr)(pcTableSets - 1);
172}
173
174inline StridePrefetcher::StrideEntry*
175StridePrefetcher::pcTableVictim(Addr pc, int master_id)
176{
177 // Rand replacement for now
178 int set = pcHash(pc);
50#include "debug/HWPrefetch.hh"
51#include "mem/cache/prefetch/stride.hh"
52
53StridePrefetcher::StridePrefetcher(const StridePrefetcherParams *p)
54 : QueuedPrefetcher(p),
55 maxConf(p->max_conf),
56 threshConf(p->thresh_conf),
57 minConf(p->min_conf),

--- 114 unchanged lines hidden (view full) ---

172 return (hash1 ^ hash2) & (Addr)(pcTableSets - 1);
173}
174
175inline StridePrefetcher::StrideEntry*
176StridePrefetcher::pcTableVictim(Addr pc, int master_id)
177{
178 // Rand replacement for now
179 int set = pcHash(pc);
179 int way = rand() % pcTableAssoc;
180 int way = random_mt.random<int>(0, pcTableAssoc - 1);
180
181 DPRINTF(HWPrefetch, "Victimizing lookup table[%d][%d].\n", set, way);
182 return &pcTable[master_id][set][way];
183}
184
185inline bool
186StridePrefetcher::pcTableHit(Addr pc, bool is_secure, int master_id,
187 StrideEntry* &entry)

--- 20 unchanged lines hidden ---
181
182 DPRINTF(HWPrefetch, "Victimizing lookup table[%d][%d].\n", set, way);
183 return &pcTable[master_id][set][way];
184}
185
186inline bool
187StridePrefetcher::pcTableHit(Addr pc, bool is_secure, int master_id,
188 StrideEntry* &entry)

--- 20 unchanged lines hidden ---