gem5  v19.0.0.0
replaceable_entry.hh
Go to the documentation of this file.
1 
31 #ifndef __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH__
32 #define __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH__
33 
34 #include <cstdint>
35 #include <memory>
36 
37 #include "base/cprintf.hh"
38 
43 struct ReplacementData {};
44 
56 {
57  protected:
61  uint32_t _set;
62 
66  uint32_t _way;
67 
68  public:
69  ReplaceableEntry() = default;
70  virtual ~ReplaceableEntry() = default;
71 
76  std::shared_ptr<ReplacementData> replacementData;
77 
84  virtual void
85  setPosition(const uint32_t set, const uint32_t way)
86  {
87  _set = set;
88  _way = way;
89  }
90 
96  uint32_t getSet() const { return _set; }
97 
103  uint32_t getWay() const { return _way; }
104 
110  virtual std::string
111  print() const
112  {
113  return csprintf("set: %#x way: %#x", getSet(), getWay());
114  }
115 };
116 
117 #endif // __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH_
uint32_t _set
Set to which this entry belongs.
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
Copyright (c) 2018 Inria All rights reserved.
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:162
std::shared_ptr< ReplacementData > replacementData
Replacement data associated to this entry.
virtual std::string print() const
Prints relevant information about this entry.
uint32_t _way
Way (relative position within the set) to which this entry belongs.
uint32_t getWay() const
Get way number.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
uint32_t getSet() const
Get set number.

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