gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
associative_set.hh
Go to the documentation of this file.
1 
29 #ifndef __CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
30 #define __CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
31 
35 
41 template<class Entry>
43  static_assert(std::is_base_of<TaggedEntry, Entry>::value,
44  "Entry must derive from TaggedEntry");
45 
47  const int associativity;
53  const int numEntries;
60 
61  public:
71  AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy,
72  ReplacementPolicy::Base *rpl_policy, Entry const &init_val = Entry());
73 
81  Entry* findEntry(Addr addr, bool is_secure) const;
82 
88  void accessEntry(Entry *entry);
89 
95  Entry* findVictim(Addr addr);
96 
104 
111  void insertEntry(Addr addr, bool is_secure, Entry* entry);
112 
118  void invalidate(Entry* entry);
119 
123 
129  {
130  return entries.begin();
131  }
132 
139  {
140  return entries.end();
141  }
142 
148  {
149  return entries.begin();
150  }
151 
158  {
159  return entries.end();
160  }
161 };
162 
163 #endif//__CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
tagged_entry.hh
AssociativeSet
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:42
AssociativeSet::AssociativeSet
AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy, ReplacementPolicy::Base *rpl_policy, Entry const &init_val=Entry())
Public constructor.
Definition: associative_set_impl.hh:36
AssociativeSet::associativity
const int associativity
Associativity of the container.
Definition: associative_set.hh:44
std::vector< Entry >
AssociativeSet::end
const_iterator end() const
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
Definition: associative_set.hh:157
AssociativeSet::findEntry
Entry * findEntry(Addr addr, bool is_secure) const
Find an entry within the set.
Definition: associative_set_impl.hh:55
base.hh
AssociativeSet::entries
std::vector< Entry > entries
Vector containing the entries of the container.
Definition: associative_set.hh:59
AssociativeSet::accessEntry
void accessEntry(Entry *entry)
Do an access to the entry, this is required to update the replacement information data.
Definition: associative_set_impl.hh:73
AssociativeSet::getPossibleEntries
std::vector< Entry * > getPossibleEntries(const Addr addr) const
Find the set of entries that could be replaced given that we want to add a new entry with the provide...
Definition: associative_set_impl.hh:95
ReplacementPolicy::Base
A common base class of cache replacement policy objects.
Definition: base.hh:48
AssociativeSet::insertEntry
void insertEntry(Addr addr, bool is_secure, Entry *entry)
Indicate that an entry has just been inserted.
Definition: associative_set_impl.hh:110
AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::iterator
typename std::vector< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::iterator iterator
Definition: associative_set.hh:122
base.hh
AssociativeSet::begin
iterator begin()
Returns an iterator to the first entry of the dictionary.
Definition: associative_set.hh:128
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
AssociativeSet::findVictim
Entry * findVictim(Addr addr)
Find a victim to be replaced.
Definition: associative_set_impl.hh:80
X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:80
AssociativeSet::numEntries
const int numEntries
Total number of entries, entries are organized in sets of the provided associativity.
Definition: associative_set.hh:53
AssociativeSet::invalidate
void invalidate(Entry *entry)
Invalidate an entry and its respective replacement data.
Definition: associative_set_impl.hh:118
AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::const_iterator
typename std::vector< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::const_iterator const_iterator
Iterator types.
Definition: associative_set.hh:121
AssociativeSet::end
iterator end()
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
Definition: associative_set.hh:138
BaseIndexingPolicy
A common base class for indexing table locations.
Definition: base.hh:63
AssociativeSet::indexingPolicy
BaseIndexingPolicy *const indexingPolicy
Pointer to the indexing policy.
Definition: associative_set.hh:55
AssociativeSet::begin
const_iterator begin() const
Returns an iterator to the first entry of the dictionary.
Definition: associative_set.hh:147
AssociativeSet::replacementPolicy
ReplacementPolicy::Base *const replacementPolicy
Pointer to the replacement policy.
Definition: associative_set.hh:57

Generated on Tue Jun 22 2021 15:28:29 for gem5 by doxygen 1.8.17