gem5  v22.1.0.0
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 
36 namespace gem5
37 {
38 
44 template<class Entry>
46 {
47  static_assert(std::is_base_of_v<TaggedEntry, Entry>,
48  "Entry must derive from TaggedEntry");
49 
51  const int associativity;
57  const int numEntries;
64 
65  public:
75  AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy,
76  replacement_policy::Base *rpl_policy, Entry const &init_val = Entry());
77 
85  Entry* findEntry(Addr addr, bool is_secure) const;
86 
92  void accessEntry(Entry *entry);
93 
100 
108 
115  void insertEntry(Addr addr, bool is_secure, Entry* entry);
116 
122  void invalidate(Entry* entry);
123 
127 
133  {
134  return entries.begin();
135  }
136 
143  {
144  return entries.end();
145  }
146 
152  {
153  return entries.begin();
154  }
155 
162  {
163  return entries.end();
164  }
165 };
166 
167 } // namespace gem5
168 
169 #endif//__CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
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...
const_iterator begin() const
Returns an iterator to the first entry of the dictionary.
BaseIndexingPolicy *const indexingPolicy
Pointer to the indexing policy.
replacement_policy::Base *const replacementPolicy
Pointer to the replacement policy.
const int associativity
Associativity of the container.
iterator begin()
Returns an iterator to the first entry of the dictionary.
std::vector< Entry > entries
Vector containing the entries of the container.
const int numEntries
Total number of entries, entries are organized in sets of the provided associativity.
void insertEntry(Addr addr, bool is_secure, Entry *entry)
Indicate that an entry has just been inserted.
Entry * findVictim(Addr addr)
Find a victim to be replaced.
void accessEntry(Entry *entry)
Do an access to the entry, this is required to update the replacement information data.
iterator end()
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy, replacement_policy::Base *rpl_policy, Entry const &init_val=Entry())
Public constructor.
const_iterator end() const
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
void invalidate(Entry *entry)
Invalidate an entry and its respective replacement data.
typename std::vector< Entry >::const_iterator const_iterator
Iterator types.
Entry * findEntry(Addr addr, bool is_secure) const
Find an entry within the set.
typename std::vector< Entry >::iterator iterator
A common base class for indexing table locations.
Definition: base.hh:67
A common base class of cache replacement policy objects.
Definition: base.hh:56
Declaration of a common framework for indexing policies.
Bitfield< 3 > addr
Definition: types.hh:84
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147

Generated on Wed Dec 21 2022 10:22:36 for gem5 by doxygen 1.9.1