gem5
v20.1.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 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, BaseReplacementPolicy *rpl_policy, Entry const &init_value=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... | |
BaseReplacementPolicy *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 117 of file associative_set.hh.
using AssociativeSet< Entry >::const_iterator = typename std::vector<Entry>::const_iterator |
Iterator types.
Definition at line 197 of file associative_set.hh.
using AssociativeSet< Entry >::iterator = typename std::vector<Entry>::iterator |
Definition at line 198 of file associative_set.hh.
AssociativeSet< Entry >::AssociativeSet | ( | int | assoc, |
int | num_entries, | ||
BaseIndexingPolicy * | idx_policy, | ||
BaseReplacementPolicy * | rpl_policy, | ||
Entry const & | init_value = Entry() |
||
) |
Public constructor.
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
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 |
initial | value of the elements of the set |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer; redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution; neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition at line 36 of file associative_set_impl.hh.
void 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 73 of file associative_set_impl.hh.
Referenced by Prefetcher::Stride::calculatePrefetch().
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 204 of file associative_set.hh.
|
inline |
Returns an iterator to the first entry of the dictionary.
Definition at line 223 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 214 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 233 of file associative_set.hh.
Entry * 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 55 of file associative_set_impl.hh.
Referenced by Prefetcher::Stride::calculatePrefetch().
Entry * AssociativeSet< Entry >::findVictim | ( | Addr | addr | ) |
Find a victim to be replaced.
addr | key to select the possible victim |
Definition at line 80 of file associative_set_impl.hh.
Referenced by Prefetcher::Stride::calculatePrefetch().
std::vector< Entry * > 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 95 of file associative_set_impl.hh.
void 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 110 of file associative_set_impl.hh.
Referenced by Prefetcher::Stride::calculatePrefetch().
void AssociativeSet< Entry >::invalidate | ( | Entry * | entry | ) |
Invalidate an entry and its respective replacement data.
entry | Entry to be invalidated. |
Definition at line 120 of file associative_set_impl.hh.
|
private |
Associativity of the container.
Definition at line 119 of file associative_set.hh.
|
private |
Vector containing the entries of the container.
Definition at line 134 of file associative_set.hh.
Referenced by AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::AssociativeSet(), AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::begin(), and AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::end().
|
private |
Pointer to the indexing policy.
Definition at line 130 of file associative_set.hh.
Referenced by AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::AssociativeSet().
|
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 128 of file associative_set.hh.
Referenced by AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::AssociativeSet().
|
private |
Pointer to the replacement policy.
Definition at line 132 of file associative_set.hh.
Referenced by AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::AssociativeSet().