gem5 v24.0.0.0
Loading...
Searching...
No Matches
tagged_entry.hh
Go to the documentation of this file.
1
29#ifndef __CACHE_TAGGED_ENTRY_HH__
30#define __CACHE_TAGGED_ENTRY_HH__
31
32#include <cassert>
33
35#include "base/cprintf.hh"
36#include "base/logging.hh"
37#include "base/types.hh"
39
40namespace gem5
41{
42
48class TaggedEntry : public CacheEntry
49{
50 public:
52 ~TaggedEntry() = default;
53
59 bool isSecure() const { return _secure; }
60
68 virtual bool
69 matchTag(Addr tag, bool is_secure) const
70 {
71 return isValid() && (getTag() == tag) && (isSecure() == is_secure);
72 }
73
80 virtual void
81 insert(const Addr tag, const bool is_secure)
82 {
83 setValid();
84 setTag(tag);
85 if (is_secure) {
86 setSecure();
87 }
88 }
89
91 void
92 invalidate() override
93 {
96 }
97
98 std::string
99 print() const override
100 {
101 return csprintf("tag: %#x secure: %d valid: %d | %s", getTag(),
103 }
104
105 bool
106 matchTag(const Addr tag) const override
107 {
108 panic("Need is_secure arg");
109 return false;
110 }
111
112 void
113 insert(const Addr tag) override
114 {
115 panic("Need is_secure arg");
116 return;
117 }
118 protected:
120 virtual void setSecure() { _secure = true; }
121
122 private:
128
130 void clearSecure() { _secure = false; }
131
134 using CacheEntry::insert;
135};
136
137} // namespace gem5
138
139#endif//__CACHE_TAGGED_ENTRY_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
A CacheEntry is an entry containing a tag.
virtual void invalidate()
Invalidate the block.
virtual Addr getTag() const
Get tag associated to this block.
virtual void setValid()
Set valid bit.
virtual bool matchTag(const Addr tag) const
Checks if the given tag information corresponds to this entry's.
Addr tag
The entry's tag.
virtual bool isValid() const
Checks if the entry is valid.
virtual void insert(const Addr tag)
Insert the block by assigning it a tag and marking it valid.
virtual void setTag(Addr _tag)
Set tag associated to this block.
virtual std::string print() const
Prints relevant information about this entry.
A tagged entry is an entry containing a tag.
void invalidate() override
Invalidate the block.
std::string print() const override
Prints relevant information about this entry.
void clearSecure()
Clear secure bit.
~TaggedEntry()=default
virtual bool matchTag(Addr tag, bool is_secure) const
Checks if the given tag information corresponds to this entry's.
virtual void insert(const Addr tag, const bool is_secure)
Insert the block by assigning it a tag and marking it valid.
bool isSecure() const
Check if this block holds data from the secure memory space.
bool matchTag(const Addr tag) const override
Checks if the given tag information corresponds to this entry's.
bool _secure
Secure bit.
void insert(const Addr tag) override
Insert the block by assigning it a tag and marking it valid.
virtual void setSecure()
Set secure bit.
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
std::string csprintf(const char *format, const Args &...args)
Definition cprintf.hh:161

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