|
gem5 [DEVELOP-FOR-25.0]
|
#include <associative_cache.hh>
Public Types | |
| using | const_iterator = typename std::vector<Entry>::const_iterator |
| Iterator types. | |
| using | iterator = typename std::vector<Entry>::iterator |
Public Member Functions | |
| AssociativeCache (std::string_view name) | |
| Empty constructor - need to call init() later with all args. | |
| AssociativeCache (std::string_view name, const size_t num_entries, const size_t associativity_, BaseReplacementPolicy *repl_policy, IndexingPolicy *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, IndexingPolicy *_indexing_policy, Entry const &init_val=Entry()) |
| void | setDebugFlag (const ::gem5::debug::SimpleFlag &flag) |
| virtual Entry * | accessEntry (const KeyType &key) |
| 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 KeyType &key) const |
| Find an entry within the set. | |
| virtual Entry * | findVictim (const KeyType &key) |
| Find a victim to be replaced. | |
| virtual void | invalidate (Entry *entry) |
| Invalidate an entry and its respective replacement data. | |
| virtual void | insertEntry (const KeyType &key, Entry *entry) |
| Indicate that an entry has just been inserted. | |
| std::vector< Entry * > | getPossibleEntries (const KeyType &key) 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 (std::string_view name_) | |
| virtual | ~Named ()=default |
| virtual std::string | name () const |
Protected Types | |
| typedef replacement_policy::Base | BaseReplacementPolicy |
| typedef Entry::IndexingPolicy | IndexingPolicy |
| typedef Entry::KeyType | KeyType |
Protected Attributes | |
| size_t | associativity |
| Associativity of the cache. | |
| BaseReplacementPolicy * | replPolicy |
| The replacement policy of the cache. | |
| IndexingPolicy * | indexingPolicy |
| Indexing policy of the cache. | |
| std::vector< Entry > | entries |
| The entries. | |
| const ::gem5::debug::SimpleFlag * | debugFlag = nullptr |
Private Member Functions | |
| void | initParams (size_t _num_entries, size_t _assoc) |
Definition at line 62 of file associative_cache.hh.
|
protected |
Definition at line 69 of file associative_cache.hh.
| using gem5::AssociativeCache< Entry >::const_iterator = typename std::vector<Entry>::const_iterator |
Iterator types.
Definition at line 307 of file associative_cache.hh.
|
protected |
Definition at line 70 of file associative_cache.hh.
| using gem5::AssociativeCache< Entry >::iterator = typename std::vector<Entry>::iterator |
Definition at line 308 of file associative_cache.hh.
|
protected |
Definition at line 71 of file associative_cache.hh.
|
inline |
Empty constructor - need to call init() later with all args.
Definition at line 106 of file associative_cache.hh.
|
inline |
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 |
| associativity | number of elements in each associative set |
| repl_policy | replacement policy |
| indexing_policy | indexing policy |
Definition at line 117 of file associative_cache.hh.
|
default |
Default destructor.
|
delete |
Disable copy and assignment.
|
inlinevirtual |
Do an access to the entry if it exists.
This is required to update the replacement information data.
| key | key to the entry |
Definition at line 182 of file associative_cache.hh.
Referenced by gem5::AssociativeCache< StrideEntry >::accessEntry(), and gem5::prefetch::Stride::calculatePrefetch().
|
inlinevirtual |
Update the replacement information for an entry.
| Entry | to access and upate |
Definition at line 198 of file associative_cache.hh.
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 315 of file associative_cache.hh.
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 336 of file associative_cache.hh.
|
inline |
Clear the entries in the cache.
Definition at line 147 of file associative_cache.hh.
|
inline |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed)
Definition at line 326 of file associative_cache.hh.
|
inline |
Returns an iterator pointing to the end of the the dictionary (placeholder element, should not be accessed)
Definition at line 347 of file associative_cache.hh.
|
inlinevirtual |
Find an entry within the set.
| key | key element |
Definition at line 217 of file associative_cache.hh.
Referenced by gem5::AssociativeCache< StrideEntry >::accessEntry(), and gem5::prefetch::Stride::calculatePrefetch().
|
inlinevirtual |
Find a victim to be replaced.
| key | key to select the possible victim |
Definition at line 237 of file associative_cache.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
|
inline |
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 291 of file associative_cache.hh.
|
inline |
Definition at line 155 of file associative_cache.hh.
|
inlineprivate |
Definition at line 90 of file associative_cache.hh.
Referenced by gem5::AssociativeCache< StrideEntry >::AssociativeCache(), and gem5::AssociativeCache< StrideEntry >::init().
|
inlinevirtual |
Indicate that an entry has just been inserted.
| key | key of the container |
| entry | pointer to the container entry to be inserted |
Definition at line 272 of file associative_cache.hh.
Referenced by gem5::prefetch::Stride::calculatePrefetch().
|
inlinevirtual |
Invalidate an entry and its respective replacement data.
| entry | Entry to be invalidated. |
Definition at line 260 of file associative_cache.hh.
Referenced by gem5::AssociativeCache< StrideEntry >::clear(), and gem5::AssociativeCache< StrideEntry >::findVictim().
|
delete |
|
inline |
Definition at line 170 of file associative_cache.hh.
|
protected |
Associativity of the cache.
Definition at line 74 of file associative_cache.hh.
|
protected |
Definition at line 85 of file associative_cache.hh.
|
protected |
The entries.
Definition at line 83 of file associative_cache.hh.
|
protected |
Indexing policy of the cache.
Definition at line 80 of file associative_cache.hh.
|
protected |
The replacement policy of the cache.
Definition at line 77 of file associative_cache.hh.