gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
random_rp.hh
Go to the documentation of this file.
1 
35 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
36 #define __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
37 
39 
40 struct RandomRPParams;
41 
42 namespace ReplacementPolicy {
43 
44 class Random : public Base
45 {
46  protected:
49  {
54  bool valid;
55 
59  RandomReplData() : valid(false) {}
60  };
61 
62  public:
63  typedef RandomRPParams Params;
64  Random(const Params &p);
65  ~Random() = default;
66 
73  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
74  const override;
75 
82  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
83  override;
84 
91  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
92  override;
93 
100  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
101  override;
102 
108  std::shared_ptr<ReplacementData> instantiateEntry() override;
109 };
110 
111 } // namespace ReplacementPolicy
112 
113 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
ReplacementPolicy::Random::RandomReplData::valid
bool valid
Flag informing if the replacement data is valid or not.
Definition: random_rp.hh:54
ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:57
ReplacementPolicy::Random
Definition: random_rp.hh:44
ReplacementPolicy::Random::Random
Random(const Params &p)
Definition: random_rp.cc:39
ReplacementPolicy::Random::invalidate
void invalidate(const std::shared_ptr< ReplacementData > &replacement_data) const override
Invalidate replacement data to set it as the next probable victim.
Definition: random_rp.cc:45
ReplacementPolicy::Random::Params
RandomRPParams Params
Definition: random_rp.hh:63
ReplacementPolicy::Random::RandomReplData::RandomReplData
RandomReplData()
Default constructor.
Definition: random_rp.hh:59
ReplacementPolicy::Random::~Random
~Random()=default
std::vector
STL vector class.
Definition: stl.hh:37
ReplacementPolicy::Random::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition: random_rp.cc:59
ReplacementPolicy
Copyright (c) 2018-2020 Inria All rights reserved.
Definition: stride.hh:64
ReplacementPolicy::ReplacementData
The replacement data needed by replacement policies.
Definition: replaceable_entry.hh:43
ReplacementPolicy::Base::Params
BaseReplacementPolicyParams Params
Definition: base.hh:51
ReplacementPolicy::Random::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: random_rp.cc:90
ReplacementPolicy::Random::RandomReplData
Random-specific implementation of replacement data.
Definition: random_rp.hh:48
ReplacementPolicy::Base
A common base class of cache replacement policy objects.
Definition: base.hh:48
base.hh
ReplacementPolicy::Random::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
Definition: random_rp.cc:67
ReplacementPolicy::Random::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition: random_rp.cc:54
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323

Generated on Tue Jun 22 2021 15:28:29 for gem5 by doxygen 1.8.17