gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 namespace replacement_policy
42 {
43 
48 struct ReplacementData {};
49 
50 } // namespace replacement_policy
51 
63 {
64  protected:
68  uint32_t _set;
69 
73  uint32_t _way;
74 
75  public:
76  ReplaceableEntry() = default;
77  virtual ~ReplaceableEntry() = default;
78 
83  std::shared_ptr<replacement_policy::ReplacementData> replacementData;
84 
91  virtual void
92  setPosition(const uint32_t set, const uint32_t way)
93  {
94  _set = set;
95  _way = way;
96  }
97 
103  uint32_t getSet() const { return _set; }
104 
110  uint32_t getWay() const { return _way; }
111 
117  virtual std::string
118  print() const
119  {
120  return csprintf("set: %#x way: %#x", getSet(), getWay());
121  }
122 };
123 
124 } // namespace gem5
125 
126 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH_
gem5::ReplaceableEntry::getSet
uint32_t getSet() const
Get set number.
Definition: replaceable_entry.hh:103
gem5::ReplaceableEntry::ReplaceableEntry
ReplaceableEntry()=default
gem5::ArmISA::set
Bitfield< 12, 11 > set
Definition: misc_types.hh:760
gem5::ReplaceableEntry::setPosition
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
Definition: replaceable_entry.hh:92
gem5::ReplaceableEntry::_way
uint32_t _way
Way (relative position within the set) to which this entry belongs.
Definition: replaceable_entry.hh:73
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:48
gem5::ReplaceableEntry::print
virtual std::string print() const
Prints relevant information about this entry.
Definition: replaceable_entry.hh:118
cprintf.hh
compiler.hh
gem5::ReplaceableEntry::getWay
uint32_t getWay() const
Get way number.
Definition: replaceable_entry.hh:110
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:62
gem5::ReplaceableEntry::_set
uint32_t _set
Set to which this entry belongs.
Definition: replaceable_entry.hh:68
gem5::ReplaceableEntry::replacementData
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
Definition: replaceable_entry.hh:83
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37

Generated on Sun Jul 30 2023 01:56:57 for gem5 by doxygen 1.8.17