gem5 v24.0.0.0
Loading...
Searching...
No Matches
base.hh
Go to the documentation of this file.
1
29#ifndef __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
30#define __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
31
32#include <memory>
33
34#include "base/compiler.hh"
36#include "mem/packet.hh"
37#include "params/BaseReplacementPolicy.hh"
38#include "sim/sim_object.hh"
39
40namespace gem5
41{
42
47
48namespace replacement_policy
49{
50
54class Base : public SimObject
55{
56 public:
57 typedef BaseReplacementPolicyParams Params;
58 Base(const Params &p) : SimObject(p) {}
59 virtual ~Base() = default;
60
66 virtual void invalidate(const std::shared_ptr<ReplacementData>&
67 replacement_data) = 0;
68
75 virtual void touch(const std::shared_ptr<ReplacementData>&
76 replacement_data, const PacketPtr pkt)
77 {
78 touch(replacement_data);
79 }
80 virtual void touch(const std::shared_ptr<ReplacementData>&
81 replacement_data) const = 0;
82
89 virtual void reset(const std::shared_ptr<ReplacementData>&
90 replacement_data, const PacketPtr pkt)
91 {
92 reset(replacement_data);
93 }
94 virtual void reset(const std::shared_ptr<ReplacementData>&
95 replacement_data) const = 0;
96
104 const ReplacementCandidates& candidates) const = 0;
105
111 virtual std::shared_ptr<ReplacementData> instantiateEntry() = 0;
112};
113
114} // namespace replacement_policy
115} // namespace gem5
116
117#endif // __MEM_CACHE_REPLACEMENT_POLICIES_BASE_HH__
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Abstract superclass for simulation objects.
A common base class of cache replacement policy objects.
Definition base.hh:55
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data)=0
Invalidate replacement data to set it as the next probable victim.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
Definition base.hh:89
BaseReplacementPolicyParams Params
Definition base.hh:57
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Update replacement data.
Definition base.hh:75
Base(const Params &p)
Definition base.hh:58
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
STL vector class.
Definition stl.hh:37
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::vector< ReplaceableEntry * > ReplacementCandidates
Replacement candidates as chosen by the indexing policy.
Definition base.hh:46
Declaration of the Packet class.

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