gem5  v22.1.0.0
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 
46 #include "base/circular_queue.hh"
47 #include "base/sat_counter.hh"
50 
51 namespace gem5
52 {
53 
54 struct STeMSPrefetcherParams;
55 
57 namespace prefetch
58 {
59 
60 class STeMS : public Queued
61 {
63  const size_t spatialRegionSize;
65  const size_t spatialRegionSizeBits;
67  const unsigned int reconstructionEntries;
68 
74  {
80  unsigned int seqCounter;
81 
84  {
88  unsigned int offset;
90  unsigned int delta;
92  {}
93  };
96 
97  ActiveGenerationTableEntry(int num_positions)
98  : TaggedEntry(), paddress(0), pc(0),
99  seqCounter(0), sequence(num_positions)
100  {
101  }
102 
103  void
104  invalidate() override
105  {
107  paddress = 0;
108  pc = 0;
109  seqCounter = 0;
110  for (auto &seq_entry : sequence) {
111  seq_entry.counter.reset();
112  seq_entry.offset = 0;
113  seq_entry.delta = 0;
114  }
115  }
116 
124  {
125  paddress = e.paddress;
126  pc = e.pc;
127  seqCounter = e.seqCounter;
128  sequence = e.sequence;
129  }
130 
135  void addOffset(unsigned int offset) {
136  // Search for the offset in the deltas array, if it exist, update
137  // the corresponding counter, if not, add the offset to the array
138  for (auto &seq_entry : sequence) {
139  if (seq_entry.counter > 0) {
140  if (seq_entry.offset == offset) {
141  seq_entry.counter++;
142  }
143  } else {
144  // If the counter is 0 it means that this position is not
145  // being used, and we can allocate the new offset here
146  seq_entry.counter++;
147  seq_entry.offset = offset;
148  seq_entry.delta = seqCounter;
149  break;
150  }
151  }
152  seqCounter = 0;
153  }
154  };
155 
160 
163  {
172  unsigned int delta;
173  };
174 
177 
180 
182  unsigned int lastTriggerCounter;
183 
192  void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta);
193 
201  void reconstructSequence(
203  std::vector<AddrPriority> &addresses);
204 
205  public:
206  STeMS(const STeMSPrefetcherParams &p);
207  ~STeMS() = default;
208 
209  void calculatePrefetch(const PrefetchInfo &pfi,
210  std::vector<AddrPriority> &addresses) override;
211 };
212 
213 } // namespace prefetch
214 } // namespace gem5
215 
216 #endif//__MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Circular queue.
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:47
virtual void invalidate()
Invalidate the block.
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:98
unsigned int lastTriggerCounter
Counter to keep the count of accesses between trigger accesses.
void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta)
Adds an entry to the RMOB.
AssociativeSet< ActiveGenerationTableEntry > activeGenerationTable
Active Generation Table (AGT)
void checkForActiveGenerationsEnd()
Checks if the active generations have ended.
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
AssociativeSet< ActiveGenerationTableEntry > patternSequenceTable
Pattern Sequence Table (PST)
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
STeMS(const STeMSPrefetcherParams &p)
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...
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< 54 > p
Definition: pagetable.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
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 Wed Dec 21 2022 10:22:36 for gem5 by doxygen 1.9.1