gem5  v20.1.0.0
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 
43 {
44  protected:
47  {
52  bool valid;
53 
57  RandomReplData() : valid(false) {}
58  };
59 
60  public:
62  typedef RandomRPParams Params;
63 
67  RandomRP(const Params *p);
68 
72  ~RandomRP() {}
73 
80  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
81  const override;
82 
89  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
90  override;
91 
98  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
99  override;
100 
107  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
108  override;
109 
115  std::shared_ptr<ReplacementData> instantiateEntry() override;
116 };
117 
118 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:53
BaseReplacementPolicy::Params
BaseReplacementPolicyParams Params
Convenience typedef.
Definition: base.hh:52
RandomRP::RandomReplData
MRU-specific implementation of replacement data.
Definition: random_rp.hh:46
RandomRP::instantiateEntry
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: random_rp.cc:88
RandomRP
Definition: random_rp.hh:42
std::vector
STL vector class.
Definition: stl.hh:37
ReplacementData
Copyright (c) 2018 Inria All rights reserved.
Definition: replaceable_entry.hh:41
RandomRP::RandomReplData::RandomReplData
RandomReplData()
Default constructor.
Definition: random_rp.hh:57
RandomRP::~RandomRP
~RandomRP()
Destructor.
Definition: random_rp.hh:72
RandomRP::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition: random_rp.cc:57
BaseReplacementPolicy
A common base class of cache replacement policy objects.
Definition: base.hh:46
RandomRP::Params
RandomRPParams Params
Convenience typedef.
Definition: random_rp.hh:62
base.hh
RandomRP::getVictim
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
Definition: random_rp.cc:65
RandomRP::touch
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition: random_rp.cc:52
RandomRP::RandomReplData::valid
bool valid
Flag informing if the replacement data is valid or not.
Definition: random_rp.hh:52
RandomRP::RandomRP
RandomRP(const Params *p)
Construct and initiliaze this replacement policy.
Definition: random_rp.cc:37
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
RandomRP::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:43

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17