base: Store a pointer to a debug flag in the AssociativeCache
This will allow to print debug information for the associative cache depending on its usage Change-Id: Ia64e1cd7cb31fcbac27d031c38cd448ea64c5b4d Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
11
src/base/cache/associative_cache.hh
vendored
11
src/base/cache/associative_cache.hh
vendored
@@ -81,6 +81,8 @@ class AssociativeCache : public Named
|
||||
/** The entries */
|
||||
std::vector<Entry> entries;
|
||||
|
||||
const ::gem5::debug::SimpleFlag* debugFlag = nullptr;
|
||||
|
||||
private:
|
||||
|
||||
void
|
||||
@@ -120,7 +122,8 @@ class AssociativeCache : public Named
|
||||
associativity(associativity_),
|
||||
replPolicy(repl_policy),
|
||||
indexingPolicy(indexing_policy),
|
||||
entries(num_entries, init_val)
|
||||
entries(num_entries, init_val),
|
||||
debugFlag(nullptr)
|
||||
{
|
||||
initParams(num_entries, associativity);
|
||||
}
|
||||
@@ -162,6 +165,12 @@ class AssociativeCache : public Named
|
||||
initParams(num_entries, associativity);
|
||||
}
|
||||
|
||||
void
|
||||
setDebugFlag(const ::gem5::debug::SimpleFlag& flag)
|
||||
{
|
||||
debugFlag = &flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do an access to the entry if it exists.
|
||||
* This is required to update the replacement information data.
|
||||
|
||||
Reference in New Issue
Block a user