gem5  v19.0.0.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 
37 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
38 #define __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
39 
41 
42 struct RandomRPParams;
43 
45 {
46  protected:
49  {
54  bool valid;
55 
59  RandomReplData() : valid(false) {}
60  };
61 
62  public:
64  typedef RandomRPParams Params;
65 
69  RandomRP(const Params *p);
70 
74  ~RandomRP() {}
75 
82  void invalidate(const std::shared_ptr<ReplacementData>& replacement_data)
83  const override;
84 
91  void touch(const std::shared_ptr<ReplacementData>& replacement_data) const
92  override;
93 
100  void reset(const std::shared_ptr<ReplacementData>& replacement_data) const
101  override;
102 
109  ReplaceableEntry* getVictim(const ReplacementCandidates& candidates) const
110  override;
111 
117  std::shared_ptr<ReplacementData> instantiateEntry() override;
118 };
119 
120 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_RANDOM_RP_HH__
MRU-specific implementation of replacement data.
Definition: random_rp.hh:48
RandomReplData()
Default constructor.
Definition: random_rp.hh:59
ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const override
Find replacement victim at random.
Definition: random_rp.cc:67
void touch(const std::shared_ptr< ReplacementData > &replacement_data) const override
Touch an entry to update its replacement data.
Definition: random_rp.cc:54
A common base class of cache replacement policy objects.
Definition: base.hh:48
STL vector class.
Definition: stl.hh:40
Copyright (c) 2018 Inria All rights reserved.
~RandomRP()
Destructor.
Definition: random_rp.hh:74
RandomRPParams Params
Convenience typedef.
Definition: random_rp.hh:64
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data.
Definition: random_rp.cc:59
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
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
bool valid
Flag informing if the replacement data is valid or not.
Definition: random_rp.hh:54
RandomRP(const Params *p)
Construct and initiliaze this replacement policy.
Definition: random_rp.cc:39
Bitfield< 0 > p
std::shared_ptr< ReplacementData > instantiateEntry() override
Instantiate a replacement data entry.
Definition: random_rp.cc:90

Generated on Fri Feb 28 2020 16:27:02 for gem5 by doxygen 1.8.13