gem5 v24.0.0.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 Member Functions | |
AssociativeSet (const char *name, const size_t num_entries, const size_t associativity_, replacement_policy::Base *repl_policy, BaseIndexingPolicy *indexing_policy, Entry const &init_val=Entry()) | |
Public constructor. | |
Entry * | findEntry (Addr addr, bool is_secure) const |
Find an entry within the set. | |
void | insertEntry (Addr addr, bool is_secure, Entry *entry) |
Indicate that an entry has just been inserted. | |
Public Member Functions inherited from gem5::AssociativeCache< Entry > | |
AssociativeCache (const char *name) | |
Empty constructor - need to call init() later with all args. | |
AssociativeCache (const char *name, const size_t num_entries, const size_t associativity_, BaseReplacementPolicy *repl_policy, BaseIndexingPolicy *indexing_policy, Entry const &init_val=Entry()) | |
Public constructor. | |
~AssociativeCache ()=default | |
Default destructor. | |
AssociativeCache (const AssociativeCache &)=delete | |
Disable copy and assignment. | |
AssociativeCache & | operator= (const AssociativeCache &)=delete |
void | clear () |
Clear the entries in the cache. | |
void | init (const size_t num_entries, const size_t associativity_, BaseReplacementPolicy *_repl_policy, BaseIndexingPolicy *_indexing_policy, Entry const &init_val=Entry()) |
virtual Addr | getTag (const Addr addr) const |
Get the tag for the addr. | |
virtual Entry * | accessEntryByAddr (const Addr addr) |
Do an access to the entry if it exists. | |
virtual void | accessEntry (Entry *entry) |
Update the replacement information for an entry. | |
virtual Entry * | findEntry (const Addr addr) const |
Find an entry within the set. | |
virtual Entry * | findVictim (const Addr addr) |
Find a victim to be replaced. | |
virtual void | invalidate (Entry *entry) |
Invalidate an entry and its respective replacement data. | |
virtual void | insertEntry (const Addr addr, Entry *entry) |
Indicate that an entry has just been inserted. | |
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. | |
iterator | begin () |
Returns an iterator to the first entry of the dictionary. | |
iterator | end () |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed) | |
const_iterator | begin () const |
Returns an iterator to the first entry of the dictionary. | |
const_iterator | end () const |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed) | |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Additional Inherited Members | |
Public Types inherited from gem5::AssociativeCache< Entry > | |
using | const_iterator = typename std::vector<Entry>::const_iterator |
Iterator types. | |
using | iterator = typename std::vector<Entry>::iterator |
Protected Attributes inherited from gem5::AssociativeCache< Entry > | |
size_t | associativity |
Associativity of the cache. | |
BaseReplacementPolicy * | replPolicy |
The replacement policy of the cache. | |
BaseIndexingPolicy * | indexingPolicy |
Indexing policy of the cache. | |
std::vector< Entry > | entries |
The entries. | |
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 48 of file associative_set.hh.
gem5::AssociativeSet< Entry >::AssociativeSet | ( | const char * | name, |
const size_t | num_entries, | ||
const size_t | associativity_, | ||
replacement_policy::Base * | repl_policy, | ||
BaseIndexingPolicy * | indexing_policy, | ||
Entry const & | init_val = Entry() ) |
Public constructor.
name | Name of the cache |
num_entries | total number of entries of the container, the number of sets can be calculated dividing this balue by the 'assoc' value |
assoc | number of elements in each associative set |
rpl_policy | replacement policy |
idx_policy | indexing policy |
init_val | initial value of the elements of the set |
Definition at line 39 of file associative_set_impl.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 52 of file associative_set_impl.hh.
References gem5::X86ISA::addr.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
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 69 of file associative_set_impl.hh.
References gem5::X86ISA::addr.
Referenced by gem5::prefetch::Stride::calculatePrefetch().