gem5  v21.1.0.2
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 
179  unsigned int lastTriggerCounter;
180 
189  void addToRMOB(Addr sr_addr, Addr pst_addr, unsigned int delta);
190 
198  void reconstructSequence(
200  std::vector<AddrPriority> &addresses);
201 
202  public:
203  STeMS(const STeMSPrefetcherParams &p);
204  ~STeMS() = default;
205 
206  void calculatePrefetch(const PrefetchInfo &pfi,
207  std::vector<AddrPriority> &addresses) override;
208 };
209 
210 } // namespace prefetch
211 } // namespace gem5
212 
213 #endif//__MEM_CACHE_PREFETCH_SPATIO_TEMPORAL_MEMORY_STREAMING_HH__
gem5::prefetch::STeMS::checkForActiveGenerationsEnd
void checkForActiveGenerationsEnd()
Checks if the active generations have ended.
Definition: spatio_temporal_memory_streaming.cc:65
gem5::prefetch::STeMS::ActiveGenerationTableEntry
Entry data type for the Active Generation Table (AGT) and the Pattern Sequence Table (PST)
Definition: spatio_temporal_memory_streaming.hh:73
gem5::prefetch::STeMS::spatialRegionSize
const size_t spatialRegionSize
Size of each spatial region.
Definition: spatio_temporal_memory_streaming.hh:63
gem5::prefetch::STeMS::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: spatio_temporal_memory_streaming.cc:123
gem5::prefetch::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:191
gem5::prefetch::STeMS::RegionMissOrderBufferEntry::srAddress
Addr srAddress
Address of the spatial region.
Definition: spatio_temporal_memory_streaming.hh:165
gem5::prefetch::STeMS::ActiveGenerationTableEntry::paddress
Addr paddress
Physical address of the spatial region.
Definition: spatio_temporal_memory_streaming.hh:76
gem5::prefetch::STeMS::RegionMissOrderBufferEntry::delta
unsigned int delta
Delta within the global miss order sequence.
Definition: spatio_temporal_memory_streaming.hh:172
gem5::ArmISA::e
Bitfield< 9 > e
Definition: misc_types.hh:64
gem5::prefetch::STeMS::ActiveGenerationTableEntry::SequenceEntry::offset
unsigned int offset
Offset, in cache lines, within the spatial region.
Definition: spatio_temporal_memory_streaming.hh:88
std::vector
STL vector class.
Definition: stl.hh:37
sat_counter.hh
gem5::prefetch::STeMS::ActiveGenerationTableEntry::seqCounter
unsigned int seqCounter
Counter to keep track of the interleaving between sequences.
Definition: spatio_temporal_memory_streaming.hh:80
queued.hh
gem5::prefetch::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:112
gem5::GenericSatCounter< uint8_t >
gem5::prefetch::STeMS::ActiveGenerationTableEntry::pc
Addr pc
PC that started this generation.
Definition: spatio_temporal_memory_streaming.hh:78
gem5::TaggedEntry
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:46
circular_queue.hh
gem5::CircularQueue::iterator
Iterator to the circular queue.
Definition: circular_queue.hh:85
gem5::prefetch::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:170
gem5::prefetch::STeMS::spatialRegionSizeBits
const size_t spatialRegionSizeBits
log_2 of the spatial region size
Definition: spatio_temporal_memory_streaming.hh:65
gem5::AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:45
gem5::prefetch::STeMS::ActiveGenerationTableEntry::invalidate
void invalidate() override
Invalidate the block.
Definition: spatio_temporal_memory_streaming.hh:104
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::prefetch::STeMS::ActiveGenerationTableEntry::SequenceEntry::delta
unsigned int delta
Intearleaving position on the global access sequence.
Definition: spatio_temporal_memory_streaming.hh:90
gem5::prefetch::STeMS::~STeMS
~STeMS()=default
gem5::prefetch::STeMS::ActiveGenerationTableEntry::SequenceEntry::SequenceEntry
SequenceEntry()
Definition: spatio_temporal_memory_streaming.hh:91
gem5::prefetch::STeMS::ActiveGenerationTableEntry::addOffset
void addOffset(unsigned int offset)
Add a new access to the sequence.
Definition: spatio_temporal_memory_streaming.hh:135
gem5::ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:144
gem5::TaggedEntry::invalidate
virtual void invalidate()
Invalidate the block.
Definition: tagged_entry.hh:103
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::prefetch::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:123
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::prefetch::STeMS::ActiveGenerationTableEntry::SequenceEntry::counter
SatCounter8 counter
2-bit confidence counter
Definition: spatio_temporal_memory_streaming.hh:86
gem5::prefetch::Queued
Definition: queued.hh:60
gem5::prefetch::STeMS::ActiveGenerationTableEntry::ActiveGenerationTableEntry
ActiveGenerationTableEntry(int num_positions)
Definition: spatio_temporal_memory_streaming.hh:97
gem5::prefetch::STeMS::STeMS
STeMS(const STeMSPrefetcherParams &p)
Definition: spatio_temporal_memory_streaming.cc:42
gem5::prefetch::STeMS::rmob
CircularQueue< RegionMissOrderBufferEntry > rmob
Region Miss Order Buffer (RMOB)
Definition: spatio_temporal_memory_streaming.hh:176
gem5::prefetch::STeMS
Definition: spatio_temporal_memory_streaming.hh:60
gem5::prefetch::STeMS::activeGenerationTable
AssociativeSet< ActiveGenerationTableEntry > activeGenerationTable
Active Generation Table (AGT)
Definition: spatio_temporal_memory_streaming.hh:157
gem5::prefetch::STeMS::reconstructionEntries
const unsigned int reconstructionEntries
Number of reconstruction entries.
Definition: spatio_temporal_memory_streaming.hh:67
gem5::prefetch::STeMS::patternSequenceTable
AssociativeSet< ActiveGenerationTableEntry > patternSequenceTable
Pattern Sequence Table (PST)
Definition: spatio_temporal_memory_streaming.hh:159
associative_set.hh
gem5::prefetch::STeMS::lastTriggerCounter
unsigned int lastTriggerCounter
Counter to keep the count of accesses between trigger accesses.
Definition: spatio_temporal_memory_streaming.hh:179
gem5::context_switch_task_id::Prefetcher
@ Prefetcher
Definition: request.hh:83
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::prefetch::STeMS::ActiveGenerationTableEntry::sequence
std::vector< SequenceEntry > sequence
Sequence of accesses.
Definition: spatio_temporal_memory_streaming.hh:95
gem5::CircularQueue
Circular queue.
Definition: circular_queue.hh:69
gem5::prefetch::STeMS::RegionMissOrderBufferEntry
Data type of the Region Miss Order Buffer entry.
Definition: spatio_temporal_memory_streaming.hh:162
gem5::prefetch::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:97
gem5::prefetch::STeMS::ActiveGenerationTableEntry::SequenceEntry
Sequence entry data type.
Definition: spatio_temporal_memory_streaming.hh:83

Generated on Tue Sep 21 2021 12:25:29 for gem5 by doxygen 1.8.17