mem-cache: Create ReplacementPolicy namespace
Encapsulate the replacement policy classes in their own namespace. As a side effect these classes have been renamed to drop the RP suffix in the C++ code. Change-Id: Ibb65dfb584a1413492fcf11833cf91a859cbff4e Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35795 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
0d5a80cb46
commit
523d42d1ce
7
src/mem/cache/prefetch/associative_set.hh
vendored
7
src/mem/cache/prefetch/associative_set.hh
vendored
@@ -54,7 +54,7 @@ class AssociativeSet {
|
||||
/** Pointer to the indexing policy */
|
||||
BaseIndexingPolicy* const indexingPolicy;
|
||||
/** Pointer to the replacement policy */
|
||||
BaseReplacementPolicy* const replacementPolicy;
|
||||
ReplacementPolicy::Base* const replacementPolicy;
|
||||
/** Vector containing the entries of the container */
|
||||
std::vector<Entry> entries;
|
||||
|
||||
@@ -66,11 +66,10 @@ class AssociativeSet {
|
||||
* of sets can be calculated dividing this balue by the 'assoc' value
|
||||
* @param idx_policy indexing policy
|
||||
* @param rpl_policy replacement policy
|
||||
* @param initial value of the elements of the set
|
||||
* @param init_val initial value of the elements of the set
|
||||
*/
|
||||
AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy,
|
||||
BaseReplacementPolicy *rpl_policy, Entry const &init_value =
|
||||
Entry());
|
||||
ReplacementPolicy::Base *rpl_policy, Entry const &init_val = Entry());
|
||||
|
||||
/**
|
||||
* Find an entry within the set
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
template<class Entry>
|
||||
AssociativeSet<Entry>::AssociativeSet(int assoc, int num_entries,
|
||||
BaseIndexingPolicy *idx_policy, BaseReplacementPolicy *rpl_policy,
|
||||
BaseIndexingPolicy *idx_policy, ReplacementPolicy::Base *rpl_policy,
|
||||
Entry const &init_value)
|
||||
: associativity(assoc), numEntries(num_entries), indexingPolicy(idx_policy),
|
||||
replacementPolicy(rpl_policy), entries(numEntries, init_value)
|
||||
|
||||
8
src/mem/cache/prefetch/stride.hh
vendored
8
src/mem/cache/prefetch/stride.hh
vendored
@@ -61,7 +61,9 @@
|
||||
#include "params/StridePrefetcherHashedSetAssociative.hh"
|
||||
|
||||
class BaseIndexingPolicy;
|
||||
class BaseReplacementPolicy;
|
||||
namespace ReplacementPolicy {
|
||||
class Base;
|
||||
}
|
||||
struct StridePrefetcherParams;
|
||||
|
||||
namespace Prefetcher {
|
||||
@@ -107,11 +109,11 @@ class Stride : public Queued
|
||||
const int numEntries;
|
||||
|
||||
BaseIndexingPolicy* const indexingPolicy;
|
||||
BaseReplacementPolicy* const replacementPolicy;
|
||||
ReplacementPolicy::Base* const replacementPolicy;
|
||||
|
||||
PCTableInfo(int assoc, int num_entries,
|
||||
BaseIndexingPolicy* indexing_policy,
|
||||
BaseReplacementPolicy* replacement_policy)
|
||||
ReplacementPolicy::Base* replacement_policy)
|
||||
: assoc(assoc), numEntries(num_entries),
|
||||
indexingPolicy(indexing_policy),
|
||||
replacementPolicy(replacement_policy)
|
||||
|
||||
Reference in New Issue
Block a user