gem5 v24.0.0.0
Loading...
Searching...
No Matches
indirect_memory.hh
Go to the documentation of this file.
1
39#ifndef __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
40#define __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
41
42#include <vector>
43
44#include "base/sat_counter.hh"
47
48namespace gem5
49{
50
51struct IndirectMemoryPrefetcherParams;
52
53namespace prefetch
54{
55
56class IndirectMemory : public Queued
57{
59 const unsigned int maxPrefetchDistance;
63 const unsigned int prefetchThreshold;
68
71 {
72 /* Stream table fields */
73
77 bool secure;
79 unsigned int streamCounter;
80
81 /* Indirect table fields */
82
84 bool enabled;
86 int64_t index;
90 int shift;
100
101 PrefetchTableEntry(unsigned indirect_counter_bits)
102 : TaggedEntry(), address(0), secure(false), streamCounter(0),
103 enabled(false), index(0), baseAddr(0), shift(0),
104 indirectCounter(indirect_counter_bits),
106 {}
107
108 void
109 invalidate() override
110 {
112 address = 0;
113 secure = false;
114 streamCounter = 0;
115 enabled = false;
116 index = 0;
117 baseAddr = 0;
118 shift = 0;
121 }
122 };
125
128 {
130 int64_t idx1;
132 int64_t idx2;
143
144 IndirectPatternDetectorEntry(unsigned int num_addresses,
145 unsigned int num_shifts)
146 : TaggedEntry(), idx1(0), idx2(0), secondIndexSet(false),
147 numMisses(0),
148 baseAddr(num_addresses, std::vector<Addr>(num_shifts))
149 {
150 }
151
152 void
153 invalidate() override
154 {
156 idx1 = 0;
157 idx2 = 0;
158 secondIndexSet = false;
159 numMisses = 0;
160 }
161 };
164
167
169 const ByteOrder byteOrder;
170
176 void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry,
177 int64_t index);
183 void trackMissIndex1(Addr miss_addr);
184
190 void trackMissIndex2(Addr miss_addr);
191
198
199 public:
200 IndirectMemory(const IndirectMemoryPrefetcherParams &p);
201 ~IndirectMemory() = default;
202
203 void calculatePrefetch(const PrefetchInfo &pfi,
204 std::vector<AddrPriority> &addresses,
205 const CacheAccessor &cache) override;
206};
207
208} // namespace prefetch
209} // namespace gem5
210
211#endif//__MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__
A tagged entry is an entry containing a tag.
void invalidate() override
Invalidate the block.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition base.hh:111
const int streamCounterThreshold
streamCounter value to trigger the streaming prefetcher
void trackMissIndex1(Addr miss_addr)
Update an IPD entry with a detected miss address, when the first index is being tracked.
AssociativeCache< IndirectPatternDetectorEntry > ipd
Indirect Pattern Detector (IPD) table.
void trackMissIndex2(Addr miss_addr)
Update an IPD entry with a detected miss address, when the second index is being tracked.
const ByteOrder byteOrder
Byte order used to access the cache.
void checkAccessMatchOnActiveEntries(Addr addr)
Checks if an access to the cache matches any active PT entry, if so, the indirect confidence counter ...
const unsigned int maxPrefetchDistance
Maximum number of prefetches generated per event.
const std::vector< int > shiftValues
Shift values considered.
IndirectPatternDetectorEntry * ipdEntryTrackingMisses
Entry currently tracking misses.
const int streamingDistance
Number of prefetches generated when using the streaming prefetcher.
AssociativeCache< PrefetchTableEntry > prefetchTable
Prefetch table.
const unsigned int prefetchThreshold
Counter threshold to start prefetching.
IndirectMemory(const IndirectMemoryPrefetcherParams &p)
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache) override
void allocateOrUpdateIPDEntry(const PrefetchTableEntry *pt_entry, int64_t index)
Allocate or update an entry in the IPD.
STL vector class.
Definition stl.hh:37
void reset()
Reset the counter to its initial value.
Bitfield< 30, 0 > index
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Bitfield< 15, 8 > vector
Definition intmessage.hh:48
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
Overload hash function for BasicBlockRange type.
Definition binary32.hh:81
Provides generic cache lookup functions.
std::vector< std::vector< Addr > > baseAddr
Potential BaseAddr candidates for each recorded miss.
IndirectPatternDetectorEntry(unsigned int num_addresses, unsigned int num_shifts)
void invalidate() override
Invalidate the block.
bool increasedIndirectCounter
This variable is set to indicate that there has been at least one match with the current index value.
bool enabled
Enable bit of the indirect fields.
bool secure
Whether this address is in the secure region.
SatCounter8 indirectCounter
Confidence counter of the indirect fields.
unsigned int streamCounter
Confidence counter of the stream.

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0