gem5 v24.1.0.1
Loading...
Searching...
No Matches
spatio_temporal_memory_streaming.hh
Go to the documentation of this file.
1
41#ifndef __MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
42#define __MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
43
44#include <vector>
45
48#include "base/sat_counter.hh"
51
52namespace gem5
53{
54
55struct STeMSPrefetcherParams;
56
57namespace prefetch
58{
59
60class STeMS : public Queued
61{
63 const size_t spatialRegionSize;
67 const unsigned int reconstructionEntries;
68
74 {
80 unsigned int seqCounter;
81
84 {
88 unsigned int offset;
90 unsigned int delta;
92 {}
93 };
96
98 : TaggedEntry(), paddress(0), pc(0),
99 seqCounter(0), sequence(num_positions)
100 {
102 }
103
104 void
105 invalidate() override
106 {
108 paddress = 0;
109 pc = 0;
110 seqCounter = 0;
111 for (auto &seq_entry : sequence) {
112 seq_entry.counter.reset();
113 seq_entry.offset = 0;
114 seq_entry.delta = 0;
115 }
116 }
117
125 {
126 paddress = e.paddress;
127 pc = e.pc;
128 seqCounter = e.seqCounter;
129 sequence = e.sequence;
130 }
131
136 void addOffset(unsigned int offset) {
137 // Search for the offset in the deltas array, if it exist, update
138 // the corresponding counter, if not, add the offset to the array
139 for (auto &seq_entry : sequence) {
140 if (seq_entry.counter > 0) {
141 if (seq_entry.offset == offset) {
142 seq_entry.counter++;
143 }
144 } else {
145 // If the counter is 0 it means that this position is not
146 // being used, and we can allocate the new offset here
147 seq_entry.counter++;
148 seq_entry.offset = offset;
149 seq_entry.delta = seqCounter;
150 break;
151 }
152 }
153 seqCounter = 0;
154 }
155 };
156
161
175
178
181
183 unsigned int lastTriggerCounter;
184
193 void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta);
194
204 std::vector<AddrPriority> &addresses);
205
206 public:
207 STeMS(const STeMSPrefetcherParams &p);
208 ~STeMS() = default;
209
210 void calculatePrefetch(const PrefetchInfo &pfi,
211 std::vector<AddrPriority> &addresses,
212 const CacheAccessor &cache) override;
213};
214
215} // namespace prefetch
216} // namespace gem5
217
218#endif//__MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
Circular queue.
A tagged entry is an entry containing a tag.
void registerTagExtractor(TagExtractor ext)
virtual void invalidate()
Invalidate the block.
std::function< Addr(Addr)> TagExtractor
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition base.hh:111
unsigned int lastTriggerCounter
Counter to keep the count of accesses between trigger accesses.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses, const CacheAccessor &cache) override
void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta)
Adds an entry to the RMOB.
AssociativeCache< ActiveGenerationTableEntry > patternSequenceTable
Pattern Sequence Table (PST)
void checkForActiveGenerationsEnd(const CacheAccessor &cache)
Checks if the active generations have ended.
CircularQueue< RegionMissOrderBufferEntry > rmob
Region Miss Order Buffer (RMOB)
bool addDuplicateEntriesToRMOB
Add duplicate entries to RMOB
const size_t spatialRegionSizeBits
log_2 of the spatial region size
const unsigned int reconstructionEntries
Number of reconstruction entries.
void reconstructSequence(CircularQueue< RegionMissOrderBufferEntry >::iterator rmob_it, std::vector< AddrPriority > &addresses)
Reconstructs a sequence of accesses and generates the prefetch addresses, adding them to the addresse...
AssociativeCache< ActiveGenerationTableEntry > activeGenerationTable
Active Generation Table (AGT)
const size_t spatialRegionSize
Size of each spatial region.
STL vector class.
Definition stl.hh:37
Bitfield< 23, 0 > offset
Definition types.hh:144
Bitfield< 9 > e
Definition misc_types.hh:65
Bitfield< 12 > ext
Bitfield< 0 > p
Copyright (c) 2024 Arm Limited 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
Provides generic cache lookup functions.
Iterator to the circular queue.
unsigned int offset
Offset, in cache lines, within the spatial region.
unsigned int delta
Intearleaving position on the global access sequence.
Entry data type for the Active Generation Table (AGT) and the Pattern Sequence Table (PST)
std::vector< SequenceEntry > sequence
Sequence of accesses.
unsigned int seqCounter
Counter to keep track of the interleaving between sequences.
void update(ActiveGenerationTableEntry const &e)
Update the entry data with an entry from a generation that just ended.
void addOffset(unsigned int offset)
Add a new access to the sequence.
Data type of the Region Miss Order Buffer entry.
Addr pstAddress
Address used to index the PST table, generated using the PC and the offset within the spatial region.
unsigned int delta
Delta within the global miss order sequence.

Generated on Mon Jan 13 2025 04:28:38 for gem5 by doxygen 1.9.8