gem5  v19.0.0.0
spatio_temporal_memory_streaming.hh
Go to the documentation of this file.
1 
43 #ifndef __MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
44 #define __MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
45 
46 #include <vector>
47 
48 #include "base/sat_counter.hh"
51 
52 struct STeMSPrefetcherParams;
53 
55 {
57  const size_t spatialRegionSize;
59  const size_t spatialRegionSizeBits;
61  const unsigned int reconstructionEntries;
62 
73  unsigned int seqCounter;
74 
76  struct SequenceEntry {
80  unsigned int offset;
82  unsigned int delta;
83  SequenceEntry() : counter(2), offset(0), delta(0)
84  {}
85  };
88 
89  ActiveGenerationTableEntry(int num_positions)
90  : TaggedEntry(), paddress(0), pc(0),
91  seqCounter(0), sequence(num_positions)
92  {
93  }
94 
95  void
96  invalidate() override
97  {
99  paddress = 0;
100  pc = 0;
101  seqCounter = 0;
102  for (auto &seq_entry : sequence) {
103  seq_entry.counter.reset();
104  seq_entry.offset = 0;
105  seq_entry.delta = 0;
106  }
107  }
108 
116  {
117  paddress = e.paddress;
118  pc = e.pc;
119  seqCounter = e.seqCounter;
120  sequence = e.sequence;
121  }
122 
127  void addOffset(unsigned int offset) {
128  // Search for the offset in the deltas array, if it exist, update
129  // the corresponding counter, if not, add the offset to the array
130  for (auto &seq_entry : sequence) {
131  if (seq_entry.counter > 0) {
132  if (seq_entry.offset == offset) {
133  seq_entry.counter++;
134  }
135  } else {
136  // If the counter is 0 it means that this position is not
137  // being used, and we can allocate the new offset here
138  seq_entry.counter++;
139  seq_entry.offset = offset;
140  seq_entry.delta = seqCounter;
141  break;
142  }
143  }
144  seqCounter = 0;
145  }
146  };
147 
152 
163  unsigned int delta;
165  bool valid;
166  };
167 
171  unsigned int rmobHead;
172 
174  unsigned int lastTriggerCounter;
175 
184  void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta);
185 
192  void reconstructSequence(unsigned int rmob_idx,
193  std::vector<AddrPriority> &addresses);
194  public:
195  STeMSPrefetcher(const STeMSPrefetcherParams* p);
197  void calculatePrefetch(const PrefetchInfo &pfi,
198  std::vector<AddrPriority> &addresses) override;
199 };
200 
201 #endif//__MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
Data type of the Region Miss Order Buffer entry.
AssociativeSet< ActiveGenerationTableEntry > patternSequenceTable
Pattern Sequence Table (PST)
const unsigned int reconstructionEntries
Number of reconstruction entries.
void checkForActiveGenerationsEnd()
Checks if the active generations have ended.
void update(ActiveGenerationTableEntry const &e)
Update the entry data with an entry from a generation that just ended.
unsigned int seqCounter
Counter to keep track of the interleaving between sequences.
void addOffset(unsigned int offset)
Add a new access to the sequence.
unsigned int delta
Intearleaving position on the global access sequence.
AssociativeSet< ActiveGenerationTableEntry > activeGenerationTable
Active Generation Table (AGT)
STL vector class.
Definition: stl.hh:40
const size_t spatialRegionSizeBits
log_2 of the spatial region size
Class containing the information needed by the prefetch to train and generate new prefetch requests...
Definition: base.hh:92
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Addr paddress
Physical address of the spatial region.
Implements an n bit saturating counter and provides methods to increment, decrement, and read it.
Definition: sat_counter.hh:57
void reconstructSequence(unsigned int rmob_idx, std::vector< AddrPriority > &addresses)
Reconstructs a sequence of accesses and generates the prefetch addresses, adding them to the addresse...
unsigned int delta
Delta within the global miss order sequence.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
std::vector< RegionMissOrderBufferEntry > rmob
Region Miss Order Buffer (RMOB)
unsigned int lastTriggerCounter
Counter to keep the count of accesses between trigger accesses.
Bitfield< 9 > e
const size_t spatialRegionSize
Size of each spatial region.
STeMSPrefetcher(const STeMSPrefetcherParams *p)
Copyright (c) 2019 Metempsy Technology Consulting All rights reserved.
unsigned int offset
Offset, in cache lines, within the spatial region.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Entry data type for the Active Generation Table (AGT) and the Pattern Sequence Table (PST) ...
virtual void invalidate()
Invalidates the entry.
Bitfield< 0 > p
void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta)
Adds an entry to the RMOB.
unsigned int rmobHead
First free position (or older, if it is full) of the RMOB.
Addr pstAddress
Address used to index the PST table, generated using the PC and the offset within the spatial region...
std::vector< SequenceEntry > sequence
Sequence of accesses.

Generated on Fri Feb 28 2020 16:27:01 for gem5 by doxygen 1.8.13