gem5  v20.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 struct STeMSPrefetcherParams;
52 
53 namespace Prefetcher {
54 
55 class STeMS : public Queued
56 {
58  const size_t spatialRegionSize;
60  const size_t spatialRegionSizeBits;
62  const unsigned int reconstructionEntries;
63 
74  unsigned int seqCounter;
75 
77  struct SequenceEntry {
81  unsigned int offset;
83  unsigned int delta;
85  {}
86  };
89 
90  ActiveGenerationTableEntry(int num_positions)
91  : TaggedEntry(), paddress(0), pc(0),
92  seqCounter(0), sequence(num_positions)
93  {
94  }
95 
96  void
97  invalidate() override
98  {
100  paddress = 0;
101  pc = 0;
102  seqCounter = 0;
103  for (auto &seq_entry : sequence) {
104  seq_entry.counter.reset();
105  seq_entry.offset = 0;
106  seq_entry.delta = 0;
107  }
108  }
109 
117  {
118  paddress = e.paddress;
119  pc = e.pc;
120  seqCounter = e.seqCounter;
121  sequence = e.sequence;
122  }
123 
128  void addOffset(unsigned int offset) {
129  // Search for the offset in the deltas array, if it exist, update
130  // the corresponding counter, if not, add the offset to the array
131  for (auto &seq_entry : sequence) {
132  if (seq_entry.counter > 0) {
133  if (seq_entry.offset == offset) {
134  seq_entry.counter++;
135  }
136  } else {
137  // If the counter is 0 it means that this position is not
138  // being used, and we can allocate the new offset here
139  seq_entry.counter++;
140  seq_entry.offset = offset;
141  seq_entry.delta = seqCounter;
142  break;
143  }
144  }
145  seqCounter = 0;
146  }
147  };
148 
153 
164  unsigned int delta;
165  };
166 
169 
171  unsigned int lastTriggerCounter;
172 
181  void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta);
182 
190  void reconstructSequence(
192  std::vector<AddrPriority> &addresses);
193 
194  public:
195  STeMS(const STeMSPrefetcherParams* p);
196  ~STeMS() = default;
197 
198  void calculatePrefetch(const PrefetchInfo &pfi,
199  std::vector<AddrPriority> &addresses) override;
200 };
201 
202 } // namespace Prefetcher
203 
204 #endif//__MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
Prefetcher::STeMS::spatialRegionSize
const size_t spatialRegionSize
Size of each spatial region.
Definition: spatio_temporal_memory_streaming.hh:58
TaggedEntry
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:39
Prefetcher::STeMS::RegionMissOrderBufferEntry
Data type of the Region Miss Order Buffer entry.
Definition: spatio_temporal_memory_streaming.hh:155
Prefetcher::STeMS::RegionMissOrderBufferEntry::pstAddress
Addr pstAddress
Address used to index the PST table, generated using the PC and the offset within the spatial region.
Definition: spatio_temporal_memory_streaming.hh:162
Prefetcher::STeMS::reconstructionEntries
const unsigned int reconstructionEntries
Number of reconstruction entries.
Definition: spatio_temporal_memory_streaming.hh:62
AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:117
Prefetcher::STeMS::ActiveGenerationTableEntry::paddress
Addr paddress
Physical address of the spatial region.
Definition: spatio_temporal_memory_streaming.hh:70
Prefetcher::STeMS::ActiveGenerationTableEntry::addOffset
void addOffset(unsigned int offset)
Add a new access to the sequence.
Definition: spatio_temporal_memory_streaming.hh:128
CircularQueue
Circular queue.
Definition: circular_queue.hh:86
Prefetcher::STeMS::ActiveGenerationTableEntry::seqCounter
unsigned int seqCounter
Counter to keep track of the interleaving between sequences.
Definition: spatio_temporal_memory_streaming.hh:74
Prefetcher::STeMS::ActiveGenerationTableEntry::SequenceEntry::offset
unsigned int offset
Offset, in cache lines, within the spatial region.
Definition: spatio_temporal_memory_streaming.hh:81
std::vector
STL vector class.
Definition: stl.hh:37
Prefetcher::STeMS::RegionMissOrderBufferEntry::delta
unsigned int delta
Delta within the global miss order sequence.
Definition: spatio_temporal_memory_streaming.hh:164
Prefetcher::STeMS::rmob
CircularQueue< RegionMissOrderBufferEntry > rmob
Region Miss Order Buffer (RMOB)
Definition: spatio_temporal_memory_streaming.hh:168
sat_counter.hh
Prefetcher::STeMS::~STeMS
~STeMS()=default
CircularQueue::iterator
Iterator to the circular queue.
Definition: circular_queue.hh:155
Prefetcher::STeMS::lastTriggerCounter
unsigned int lastTriggerCounter
Counter to keep the count of accesses between trigger accesses.
Definition: spatio_temporal_memory_streaming.hh:171
Prefetcher::STeMS::STeMS
STeMS(const STeMSPrefetcherParams *p)
Definition: spatio_temporal_memory_streaming.cc:37
Prefetcher::STeMS::spatialRegionSizeBits
const size_t spatialRegionSizeBits
log_2 of the spatial region size
Definition: spatio_temporal_memory_streaming.hh:60
Prefetcher::STeMS::checkForActiveGenerationsEnd
void checkForActiveGenerationsEnd()
Checks if the active generations have ended.
Definition: spatio_temporal_memory_streaming.cc:60
Prefetcher::STeMS::ActiveGenerationTableEntry::SequenceEntry::delta
unsigned int delta
Intearleaving position on the global access sequence.
Definition: spatio_temporal_memory_streaming.hh:83
queued.hh
Prefetcher::STeMS::ActiveGenerationTableEntry::SequenceEntry::counter
SatCounter counter
2-bit confidence counter
Definition: spatio_temporal_memory_streaming.hh:79
Prefetcher::STeMS::ActiveGenerationTableEntry::SequenceEntry
Sequence entry data type.
Definition: spatio_temporal_memory_streaming.hh:77
circular_queue.hh
Prefetcher::STeMS::ActiveGenerationTableEntry::SequenceEntry::SequenceEntry
SequenceEntry()
Definition: spatio_temporal_memory_streaming.hh:84
Prefetcher::STeMS::addToRMOB
void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta)
Adds an entry to the RMOB.
Definition: spatio_temporal_memory_streaming.cc:107
Prefetcher
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Prefetcher::STeMS::activeGenerationTable
AssociativeSet< ActiveGenerationTableEntry > activeGenerationTable
Active Generation Table (AGT)
Definition: spatio_temporal_memory_streaming.hh:150
Prefetcher::STeMS::ActiveGenerationTableEntry::invalidate
void invalidate() override
Invalidates the entry.
Definition: spatio_temporal_memory_streaming.hh:97
Prefetcher::STeMS::ActiveGenerationTableEntry::sequence
std::vector< SequenceEntry > sequence
Sequence of accesses.
Definition: spatio_temporal_memory_streaming.hh:88
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Prefetcher::Queued
Definition: queued.hh:54
Prefetcher::STeMS::ActiveGenerationTableEntry::pc
Addr pc
PC that started this generation.
Definition: spatio_temporal_memory_streaming.hh:72
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
SatCounter
Implements an n bit saturating counter and provides methods to increment, decrement,...
Definition: sat_counter.hh:54
Prefetcher::STeMS::ActiveGenerationTableEntry::update
void update(ActiveGenerationTableEntry const &e)
Update the entry data with an entry from a generation that just ended.
Definition: spatio_temporal_memory_streaming.hh:116
TaggedEntry::invalidate
virtual void invalidate()
Invalidates the entry.
Definition: associative_set.hh:69
Prefetcher::STeMS::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: spatio_temporal_memory_streaming.cc:118
Prefetcher::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:90
Prefetcher::STeMS::patternSequenceTable
AssociativeSet< ActiveGenerationTableEntry > patternSequenceTable
Pattern Sequence Table (PST)
Definition: spatio_temporal_memory_streaming.hh:152
Prefetcher::STeMS::ActiveGenerationTableEntry::ActiveGenerationTableEntry
ActiveGenerationTableEntry(int num_positions)
Definition: spatio_temporal_memory_streaming.hh:90
associative_set.hh
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Prefetcher::STeMS
Definition: spatio_temporal_memory_streaming.hh:55
Prefetcher::STeMS::reconstructSequence
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...
Definition: spatio_temporal_memory_streaming.cc:186
Prefetcher::STeMS::RegionMissOrderBufferEntry::srAddress
Addr srAddress
Address of the spatial region.
Definition: spatio_temporal_memory_streaming.hh:157
Prefetcher::STeMS::ActiveGenerationTableEntry
Entry data type for the Active Generation Table (AGT) and the Pattern Sequence Table (PST)
Definition: spatio_temporal_memory_streaming.hh:68
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17