gem5  v21.1.0.2
replaceable_entry.hh
Go to the documentation of this file.
1 
29 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH__
30 #define __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH__
31 
32 #include <cstdint>
33 #include <memory>
34 
35 #include "base/compiler.hh"
36 #include "base/cprintf.hh"
37 
38 namespace gem5
39 {
40 
41 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
42 namespace replacement_policy
43 {
44 
49 struct ReplacementData {};
50 
51 } // namespace replacement_policy
52 
64 {
65  protected:
69  uint32_t _set;
70 
74  uint32_t _way;
75 
76  public:
77  ReplaceableEntry() = default;
78  virtual ~ReplaceableEntry() = default;
79 
84  std::shared_ptr<replacement_policy::ReplacementData> replacementData;
85 
92  virtual void
93  setPosition(const uint32_t set, const uint32_t way)
94  {
95  _set = set;
96  _way = way;
97  }
98 
104  uint32_t getSet() const { return _set; }
105 
111  uint32_t getWay() const { return _way; }
112 
118  virtual std::string
119  print() const
120  {
121  return csprintf("set: %#x way: %#x", getSet(), getWay());
122  }
123 };
124 
125 } // namespace gem5
126 
127 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH_
gem5::ReplaceableEntry::getSet
uint32_t getSet() const
Get set number.
Definition: replaceable_entry.hh:104
gem5::ReplaceableEntry::ReplaceableEntry
ReplaceableEntry()=default
gem5::ReplaceableEntry::setPosition
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
Definition: replaceable_entry.hh:93
gem5::ReplaceableEntry::_way
uint32_t _way
Way (relative position within the set) to which this entry belongs.
Definition: replaceable_entry.hh:74
gem5::csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
gem5::ReplaceableEntry::~ReplaceableEntry
virtual ~ReplaceableEntry()=default
gem5::replacement_policy::ReplacementData
The replacement data needed by replacement policies.
Definition: replaceable_entry.hh:49
gem5::ReplaceableEntry::print
virtual std::string print() const
Prints relevant information about this entry.
Definition: replaceable_entry.hh:119
cprintf.hh
compiler.hh
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::ReplaceableEntry::getWay
uint32_t getWay() const
Get way number.
Definition: replaceable_entry.hh:111
gem5::ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:63
gem5::ReplaceableEntry::_set
uint32_t _set
Set to which this entry belongs.
Definition: replaceable_entry.hh:69
gem5::ReplaceableEntry::replacementData
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
Definition: replaceable_entry.hh:84
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40

Generated on Tue Sep 21 2021 12:25:30 for gem5 by doxygen 1.8.17