gem5
[DEVELOP-FOR-23.0]
|
Associative container based on the previosuly defined Entry type Each element is indexed by a key of type Addr, an additional bool value is used as an additional tag data of the entry. More...
#include <associative_set.hh>
Public Types | |
using | const_iterator = typename std::vector< Entry >::const_iterator |
Iterator types. More... | |
using | iterator = typename std::vector< Entry >::iterator |
Public Member Functions | |
AssociativeSet (int assoc, int num_entries, BaseIndexingPolicy *idx_policy, replacement_policy::Base *rpl_policy, Entry const &init_val=Entry()) | |
Public constructor. More... | |
Entry * | findEntry (Addr addr, bool is_secure) const |
Find an entry within the set. More... | |
void | accessEntry (Entry *entry) |
Do an access to the entry, this is required to update the replacement information data. More... | |
Entry * | findVictim (Addr addr) |
Find a victim to be replaced. More... | |
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 provided key. More... | |
void | insertEntry (Addr addr, bool is_secure, Entry *entry) |
Indicate that an entry has just been inserted. More... | |
void | invalidate (Entry *entry) |
Invalidate an entry and its respective replacement data. More... | |
iterator | begin () |
Returns an iterator to the first entry of the dictionary. More... | |
iterator | end () |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed) More... | |
const_iterator | begin () const |
Returns an iterator to the first entry of the dictionary. More... | |
const_iterator | end () const |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed) More... | |
Private Attributes | |
const int | associativity |
Associativity of the container. More... | |
const int | numEntries |
Total number of entries, entries are organized in sets of the provided associativity. More... | |
BaseIndexingPolicy *const | indexingPolicy |
Pointer to the indexing policy. More... | |
replacement_policy::Base *const | replacementPolicy |
Pointer to the replacement policy. More... | |
std::vector< Entry > | entries |
Vector containing the entries of the container. More... | |
Associative container based on the previosuly defined Entry type Each element is indexed by a key of type Addr, an additional bool value is used as an additional tag data of the entry.
Definition at line 45 of file associative_set.hh.
using gem5::AssociativeSet< Entry >::const_iterator = typename std::vector<Entry>::const_iterator |
Iterator types.
Definition at line 125 of file associative_set.hh.
using gem5::AssociativeSet< Entry >::iterator = typename std::vector<Entry>::iterator |
Definition at line 126 of file associative_set.hh.
gem5::AssociativeSet< Entry >::AssociativeSet | ( | int | assoc, |
int | num_entries, | ||
BaseIndexingPolicy * | idx_policy, | ||
replacement_policy::Base * | rpl_policy, | ||
Entry const & | init_val = Entry() |
||
) |
Public constructor.
assoc | number of elements in each associative set |
num_entries | total number of entries of the container, the number of sets can be calculated dividing this balue by the 'assoc' value |
idx_policy | indexing policy |
rpl_policy | replacement policy |
init_val | initial value of the elements of the set |
Definition at line 39 of file associative_set_impl.hh.
void gem5::AssociativeSet< Entry >::accessEntry | ( | Entry * | entry | ) |
Do an access to the entry, this is required to update the replacement information data.
entry | the accessed entry |
Definition at line 76 of file associative_set_impl.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 132 of file associative_set.hh.
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 151 of file associative_set.hh.
|
inline |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed)
Definition at line 142 of file associative_set.hh.
|
inline |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed)
Definition at line 161 of file associative_set.hh.
Entry * gem5::AssociativeSet< Entry >::findEntry | ( | Addr | addr, |
bool | is_secure | ||
) | const |
Find an entry within the set.
addr | key element |
is_secure | tag element |
Definition at line 58 of file associative_set_impl.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
Entry * gem5::AssociativeSet< Entry >::findVictim | ( | Addr | addr | ) |
Find a victim to be replaced.
addr | key to select the possible victim |
Definition at line 83 of file associative_set_impl.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
std::vector< Entry * > gem5::AssociativeSet< 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 provided key.
addr | key to select the set of entries |
Definition at line 98 of file associative_set_impl.hh.
void gem5::AssociativeSet< Entry >::insertEntry | ( | Addr | addr, |
bool | is_secure, | ||
Entry * | entry | ||
) |
Indicate that an entry has just been inserted.
addr | key of the container |
is_secure | tag component of the container |
entry | pointer to the container entry to be inserted |
Definition at line 113 of file associative_set_impl.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
void gem5::AssociativeSet< Entry >::invalidate | ( | Entry * | entry | ) |
Invalidate an entry and its respective replacement data.
entry | Entry to be invalidated. |
Definition at line 121 of file associative_set_impl.hh.
Referenced by gem5::AssociativeSet< gem5::prefetch::SignaturePath::PatternEntry >::invalidate().
|
private |
Associativity of the container.
Definition at line 48 of file associative_set.hh.
|
private |
Vector containing the entries of the container.
Definition at line 63 of file associative_set.hh.
Referenced by gem5::AssociativeSet< gem5::prefetch::SignaturePath::PatternEntry >::begin(), and gem5::AssociativeSet< gem5::prefetch::SignaturePath::PatternEntry >::end().
|
private |
Pointer to the indexing policy.
Definition at line 59 of file associative_set.hh.
|
private |
Total number of entries, entries are organized in sets of the provided associativity.
The number of associative sets is obtained by dividing numEntries by associativity.
Definition at line 57 of file associative_set.hh.
|
private |
Pointer to the replacement policy.
Definition at line 61 of file associative_set.hh.