gem5
v19.0.0.0
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
i
l
m
o
p
r
s
t
v
x
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
i
l
m
o
p
r
s
t
v
w
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
mem
cache
prefetch
stride.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Inria
3
* Copyright (c) 2012-2013, 2015 ARM Limited
4
* All rights reserved
5
*
6
* The license below extends only to copyright in the software and shall
7
* not be construed as granting a license to any other intellectual
8
* property including but not limited to intellectual property relating
9
* to a hardware implementation of the functionality of the software
10
* licensed hereunder. You may use the software subject to the license
11
* terms below provided that you ensure that this notice is replicated
12
* unmodified and in its entirety in all distributions of the software,
13
* modified or unmodified, in source code or in binary form.
14
*
15
* Copyright (c) 2005 The Regents of The University of Michigan
16
* All rights reserved.
17
*
18
* Redistribution and use in source and binary forms, with or without
19
* modification, are permitted provided that the following conditions are
20
* met: redistributions of source code must retain the above copyright
21
* notice, this list of conditions and the following disclaimer;
22
* redistributions in binary form must reproduce the above copyright
23
* notice, this list of conditions and the following disclaimer in the
24
* documentation and/or other materials provided with the distribution;
25
* neither the name of the copyright holders nor the names of its
26
* contributors may be used to endorse or promote products derived from
27
* this software without specific prior written permission.
28
*
29
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
*
41
* Authors: Ron Dreslinski
42
* Daniel Carvalho
43
*/
44
50
#ifndef __MEM_CACHE_PREFETCH_STRIDE_HH__
51
#define __MEM_CACHE_PREFETCH_STRIDE_HH__
52
53
#include <string>
54
#include <unordered_map>
55
#include <vector>
56
57
#include "
base/types.hh
"
58
#include "
mem/cache/prefetch/queued.hh
"
59
#include "
mem/cache/replacement_policies/replaceable_entry.hh
"
60
#include "
mem/packet.hh
"
61
62
class
BaseReplacementPolicy
;
63
struct
StridePrefetcherParams;
64
65
class
StridePrefetcher
:
public
QueuedPrefetcher
66
{
67
protected
:
68
const
int
maxConf
;
69
const
int
threshConf
;
70
const
int
minConf
;
71
const
int
startConf
;
72
73
const
int
pcTableAssoc
;
74
const
int
pcTableSets
;
75
76
const
bool
useMasterId
;
77
78
const
int
degree
;
79
81
BaseReplacementPolicy
*
replacementPolicy
;
82
83
struct
StrideEntry
:
public
ReplaceableEntry
84
{
86
StrideEntry
();
87
89
void
invalidate
();
90
91
Addr
instAddr
;
92
Addr
lastAddr
;
93
bool
isSecure
;
94
int
stride
;
95
int
confidence
;
96
};
97
98
class
PCTable
99
{
100
public
:
109
PCTable
(
int
assoc,
int
sets,
const
std::string
name
,
110
BaseReplacementPolicy
* replacementPolicy);
111
115
~
PCTable
();
116
124
StrideEntry
* findEntry(
Addr
pc
,
bool
is_secure);
125
132
StrideEntry
* findVictim(
Addr
pc);
133
134
private
:
135
const
std::string
name
() {
return
_name; }
136
const
int
pcTableSets
;
137
const
std::string
_name
;
138
std::vector<std::vector<StrideEntry>
>
entries
;
139
143
BaseReplacementPolicy
*
replacementPolicy
;
144
151
Addr
pcHash(
Addr
pc)
const
;
152
};
153
std::unordered_map<int, PCTable>
pcTables
;
154
162
PCTable
*
findTable
(
int
context);
163
170
PCTable
*
allocateNewContext
(
int
context);
171
172
public
:
173
StridePrefetcher
(
const
StridePrefetcherParams *
p
);
174
175
void
calculatePrefetch
(
const
PrefetchInfo
&pfi,
176
std::vector<AddrPriority>
&addresses)
override
;
177
};
178
179
#endif // __MEM_CACHE_PREFETCH_STRIDE_HH__
StridePrefetcher::degree
const int degree
Definition:
stride.hh:78
StridePrefetcher::allocateNewContext
PCTable * allocateNewContext(int context)
Create a PC table for the given context.
Definition:
stride.cc:106
StridePrefetcher::StrideEntry::isSecure
bool isSecure
Definition:
stride.hh:93
StridePrefetcher::StrideEntry::invalidate
void invalidate()
Invalidate the entry.
Definition:
stride.cc:69
StridePrefetcher::PCTable::pcTableSets
const int pcTableSets
Definition:
stride.hh:136
StridePrefetcher::StridePrefetcher
StridePrefetcher(const StridePrefetcherParams *p)
Definition:
stride.cc:78
StridePrefetcher::StrideEntry::confidence
int confidence
Definition:
stride.hh:95
StridePrefetcher::PCTable::name
const std::string name()
Definition:
stride.hh:135
StridePrefetcher::StrideEntry::instAddr
Addr instAddr
Definition:
stride.hh:91
StridePrefetcher::startConf
const int startConf
Definition:
stride.hh:71
StridePrefetcher::replacementPolicy
BaseReplacementPolicy * replacementPolicy
Replacement policy used in the PC tables.
Definition:
stride.hh:81
StridePrefetcher::StrideEntry
Definition:
stride.hh:83
StridePrefetcher::StrideEntry::lastAddr
Addr lastAddr
Definition:
stride.hh:92
queued.hh
QueuedPrefetcher
Definition:
queued.hh:54
BaseReplacementPolicy
A common base class of cache replacement policy objects.
Definition:
base.hh:48
std::vector
STL vector class.
Definition:
stl.hh:40
StridePrefetcher::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition:
stride.cc:141
StridePrefetcher
Definition:
stride.hh:65
StridePrefetcher::PCTable
Definition:
stride.hh:98
MipsISA::pc
Bitfield< 4 > pc
Definition:
pra_constants.hh:242
BasePrefetcher::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition:
base.hh:92
StridePrefetcher::useMasterId
const bool useMasterId
Definition:
stride.hh:76
StridePrefetcher::pcTableSets
const int pcTableSets
Definition:
stride.hh:74
StridePrefetcher::PCTable::entries
std::vector< std::vector< StrideEntry > > entries
Definition:
stride.hh:138
StridePrefetcher::minConf
const int minConf
Definition:
stride.hh:70
types.hh
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:142
SimObject::name
virtual const std::string name() const
Definition:
sim_object.hh:120
StridePrefetcher::findTable
PCTable * findTable(int context)
Try to find a table of entries for the given context.
Definition:
stride.cc:94
StridePrefetcher::StrideEntry::StrideEntry
StrideEntry()
Default constructor.
Definition:
stride.cc:63
replaceable_entry.hh
packet.hh
Declaration of the Packet class.
StridePrefetcher::pcTables
std::unordered_map< int, PCTable > pcTables
Definition:
stride.hh:153
ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition:
replaceable_entry.hh:55
StridePrefetcher::threshConf
const int threshConf
Definition:
stride.hh:69
MipsISA::p
Bitfield< 0 > p
Definition:
pra_constants.hh:325
StridePrefetcher::PCTable::replacementPolicy
BaseReplacementPolicy * replacementPolicy
Replacement policy used by StridePrefetcher.
Definition:
stride.hh:143
StridePrefetcher::pcTableAssoc
const int pcTableAssoc
Definition:
stride.hh:73
StridePrefetcher::StrideEntry::stride
int stride
Definition:
stride.hh:94
StridePrefetcher::PCTable::_name
const std::string _name
Definition:
stride.hh:137
StridePrefetcher::maxConf
const int maxConf
Definition:
stride.hh:68
Generated on Fri Feb 28 2020 16:27:01 for gem5 by
doxygen
1.8.13