gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
38namespace gem5
39{
40
41namespace replacement_policy
42{
43
49
50} // namespace replacement_policy
51
63{
64 protected:
68 uint32_t _set;
69
73 uint32_t _way;
74
75 public:
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_
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
virtual ~ReplaceableEntry()=default
uint32_t getWay() const
Get way number.
uint32_t _set
Set to which this entry belongs.
uint32_t getSet() const
Get set number.
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
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.
Bitfield< 12, 11 > set
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::string csprintf(const char *format, const Args &...args)
Definition cprintf.hh:161
The replacement data needed by replacement policies.

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0