gem5  v20.1.0.0
irregular_stream_buffer.hh
Go to the documentation of this file.
1 
38 #ifndef __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
39 #define __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
40 
41 #include "base/callback.hh"
42 #include "base/sat_counter.hh"
45 
46 struct IrregularStreamBufferPrefetcherParams;
47 
48 namespace Prefetcher {
49 
51 {
53  const size_t chunkSize;
57  const unsigned degree;
58 
63  struct TrainingUnitEntry : public TaggedEntry {
66  };
69 
71  struct AddressMapping {
75  {}
76  };
77 
83  {
85  AddressMappingEntry(size_t num_mappings, unsigned counter_bits)
86  : TaggedEntry(), mappings(num_mappings, counter_bits)
87  {
88  }
89 
90  void
91  invalidate() override
92  {
94  for (auto &entry : mappings) {
95  entry.address = 0;
96  entry.counter.reset();
97  }
98  }
99  };
100 
110 
117  void addStructuralToPhysicalEntry(Addr structuralAddress, bool is_secure,
118  Addr physical_address);
119 
128  AddressMapping& getPSMapping(Addr paddr, bool is_secure);
129  public:
130  IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams *p);
131  ~IrregularStreamBuffer() = default;
132 
133  void calculatePrefetch(const PrefetchInfo &pfi,
134  std::vector<AddrPriority> &addresses) override;
135 };
136 
137 } // namespace Prefetcher
138 
139 #endif//__MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
Prefetcher::IrregularStreamBuffer::AddressMapping::address
Addr address
Definition: irregular_stream_buffer.hh:72
Prefetcher::IrregularStreamBuffer::degree
const unsigned degree
Number of maximum prefetches requests created when predicting.
Definition: irregular_stream_buffer.hh:57
TaggedEntry
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:39
AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:117
std::vector
STL vector class.
Definition: stl.hh:37
Prefetcher::IrregularStreamBuffer::TrainingUnitEntry::lastAddress
Addr lastAddress
Definition: irregular_stream_buffer.hh:64
sat_counter.hh
Prefetcher::IrregularStreamBuffer
Definition: irregular_stream_buffer.hh:50
queued.hh
Prefetcher::IrregularStreamBuffer::AddressMappingEntry::invalidate
void invalidate() override
Invalidates the entry.
Definition: irregular_stream_buffer.hh:91
Prefetcher::IrregularStreamBuffer::spAddressMappingCache
AssociativeSet< AddressMappingEntry > spAddressMappingCache
Structured-to-Physical mappings table.
Definition: irregular_stream_buffer.hh:104
Prefetcher::IrregularStreamBuffer::IrregularStreamBuffer
IrregularStreamBuffer(const IrregularStreamBufferPrefetcherParams *p)
Definition: irregular_stream_buffer.cc:37
Prefetcher::IrregularStreamBuffer::calculatePrefetch
void calculatePrefetch(const PrefetchInfo &pfi, std::vector< AddrPriority > &addresses) override
Definition: irregular_stream_buffer.cc:64
Prefetcher::IrregularStreamBuffer::structuralAddressCounter
uint64_t structuralAddressCounter
Counter of allocated structural addresses, increased by "chunkSize", each time a new structured addre...
Definition: irregular_stream_buffer.hh:109
Prefetcher::IrregularStreamBuffer::trainingUnit
AssociativeSet< TrainingUnitEntry > trainingUnit
Map of PCs to Training unit entries.
Definition: irregular_stream_buffer.hh:68
Prefetcher::IrregularStreamBuffer::prefetchCandidatesPerEntry
const unsigned prefetchCandidatesPerEntry
Number of prefetch candidates per Physical-to-Structural entry.
Definition: irregular_stream_buffer.hh:55
Prefetcher::IrregularStreamBuffer::getPSMapping
AddressMapping & getPSMapping(Addr paddr, bool is_secure)
Obtain the Physical-to-Structured mapping entry of the given physical address.
Definition: irregular_stream_buffer.cc:171
Prefetcher
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: base.hh:78
Prefetcher::IrregularStreamBuffer::AddressMappingEntry
Maps a set of contiguous addresses to another set of (not necessarily contiguos) addresses,...
Definition: irregular_stream_buffer.hh:82
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Prefetcher::IrregularStreamBuffer::TrainingUnitEntry
Training Unit Entry datatype, it holds the last accessed address and its secure flag.
Definition: irregular_stream_buffer.hh:63
Prefetcher::Queued
Definition: queued.hh:54
Prefetcher::IrregularStreamBuffer::AddressMapping::counter
SatCounter counter
Definition: irregular_stream_buffer.hh:73
SatCounter
Implements an n bit saturating counter and provides methods to increment, decrement,...
Definition: sat_counter.hh:54
Prefetcher::IrregularStreamBuffer::AddressMappingEntry::AddressMappingEntry
AddressMappingEntry(size_t num_mappings, unsigned counter_bits)
Definition: irregular_stream_buffer.hh:85
TaggedEntry::invalidate
virtual void invalidate()
Invalidates the entry.
Definition: associative_set.hh:69
Prefetcher::IrregularStreamBuffer::addStructuralToPhysicalEntry
void addStructuralToPhysicalEntry(Addr structuralAddress, bool is_secure, Addr physical_address)
Add a mapping to the Structured-to-Physica mapping table.
Definition: irregular_stream_buffer.cc:190
Prefetcher::Base::PrefetchInfo
Class containing the information needed by the prefetch to train and generate new prefetch requests.
Definition: base.hh:90
Prefetcher::IrregularStreamBuffer::AddressMapping
Address Mapping entry, holds an address and a confidence counter.
Definition: irregular_stream_buffer.hh:71
associative_set.hh
Prefetcher::IrregularStreamBuffer::AddressMappingEntry::mappings
std::vector< AddressMapping > mappings
Definition: irregular_stream_buffer.hh:84
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Prefetcher::IrregularStreamBuffer::chunkSize
const size_t chunkSize
Size in bytes of a temporal stream.
Definition: irregular_stream_buffer.hh:53
Prefetcher::IrregularStreamBuffer::~IrregularStreamBuffer
~IrregularStreamBuffer()=default
callback.hh
Prefetcher::IrregularStreamBuffer::TrainingUnitEntry::lastAddressSecure
bool lastAddressSecure
Definition: irregular_stream_buffer.hh:65
Prefetcher::IrregularStreamBuffer::AddressMapping::AddressMapping
AddressMapping(unsigned bits)
Definition: irregular_stream_buffer.hh:74
Prefetcher::IrregularStreamBuffer::psAddressMappingCache
AssociativeSet< AddressMappingEntry > psAddressMappingCache
Physical-to-Structured mappings table.
Definition: irregular_stream_buffer.hh:102
bits
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:75

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