gem5  v20.1.0.0
associative_set.hh
Go to the documentation of this file.
1 
29 #ifndef __CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
30 #define __CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
31 
35 
39 class TaggedEntry : public ReplaceableEntry {
43  bool valid;
45  bool secure;
46  public:
47  TaggedEntry() : tag(0), valid(false), secure(false) {}
48  virtual ~TaggedEntry() {}
49 
54  bool isValid() const
55  {
56  return valid;
57  }
58 
62  void setValid()
63  {
64  valid = true;
65  }
66 
68  virtual void
70  {
71  valid = false;
72  }
73 
78  Addr getTag() const
79  {
80  return tag;
81  }
82 
87  void setTag(Addr t)
88  {
89  tag = t;
90  }
91 
96  bool isSecure() const
97  {
98  return secure;
99  }
100 
105  void setSecure(bool s)
106  {
107  secure = s;
108  }
109 };
110 
116 template<class Entry>
118  static_assert(std::is_base_of<TaggedEntry, Entry>::value,
119  "Entry must derive from TaggedEntry");
120 
122  const int associativity;
128  const int numEntries;
135 
136  public:
146  AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy,
147  BaseReplacementPolicy *rpl_policy, Entry const &init_value =
148  Entry());
149 
157  Entry* findEntry(Addr addr, bool is_secure) const;
158 
164  void accessEntry(Entry *entry);
165 
171  Entry* findVictim(Addr addr);
172 
180 
187  void insertEntry(Addr addr, bool is_secure, Entry* entry);
188 
194  void invalidate(Entry* entry);
195 
199 
205  {
206  return entries.begin();
207  }
208 
215  {
216  return entries.end();
217  }
218 
224  {
225  return entries.begin();
226  }
227 
234  {
235  return entries.end();
236  }
237 };
238 
239 #endif//__CACHE_PREFETCH_ASSOCIATIVE_SET_HH__
TaggedEntry::~TaggedEntry
virtual ~TaggedEntry()
Definition: associative_set.hh:48
ReplaceableEntry
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
Definition: replaceable_entry.hh:53
TaggedEntry::valid
bool valid
Valid bit.
Definition: associative_set.hh:43
TaggedEntry
Copyright (c) 2018 Metempsy Technology Consulting All rights reserved.
Definition: associative_set.hh:39
AssociativeSet
Associative container based on the previosuly defined Entry type Each element is indexed by a key of ...
Definition: associative_set.hh:117
AssociativeSet::associativity
const int associativity
Associativity of the container.
Definition: associative_set.hh:119
std::vector< Entry >
TaggedEntry::getTag
Addr getTag() const
Obtain the entry tag.
Definition: associative_set.hh:78
AssociativeSet::end
const_iterator end() const
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
Definition: associative_set.hh:233
TaggedEntry::tag
Addr tag
Tag for the entry.
Definition: associative_set.hh:41
AssociativeSet::findEntry
Entry * findEntry(Addr addr, bool is_secure) const
Find an entry within the set.
Definition: associative_set_impl.hh:55
base.hh
replaceable_entry.hh
AssociativeSet::entries
std::vector< Entry > entries
Vector containing the entries of the container.
Definition: associative_set.hh:134
AssociativeSet::accessEntry
void accessEntry(Entry *entry)
Do an access to the entry, this is required to update the replacement information data.
Definition: associative_set_impl.hh:73
TaggedEntry::secure
bool secure
Whether this entry refers to a memory area in the secure space.
Definition: associative_set.hh:45
BaseReplacementPolicy
A common base class of cache replacement policy objects.
Definition: base.hh:46
AssociativeSet::getPossibleEntries
std::vector< Entry * > getPossibleEntries(const Addr addr) const
Find the set of entries that could be replaced given that we want to add a new entry with the provide...
Definition: associative_set_impl.hh:95
TaggedEntry::isSecure
bool isSecure() const
Consult if this entry refers to a memory in the secure area.
Definition: associative_set.hh:96
AssociativeSet::insertEntry
void insertEntry(Addr addr, bool is_secure, Entry *entry)
Indicate that an entry has just been inserted.
Definition: associative_set_impl.hh:110
TaggedEntry::TaggedEntry
TaggedEntry()
Definition: associative_set.hh:47
AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::iterator
typename std::vector< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::iterator iterator
Definition: associative_set.hh:198
base.hh
AssociativeSet::begin
iterator begin()
Returns an iterator to the first entry of the dictionary.
Definition: associative_set.hh:204
TaggedEntry::setValid
void setValid()
Sets the entry to valid.
Definition: associative_set.hh:62
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
AssociativeSet::findVictim
Entry * findVictim(Addr addr)
Find a victim to be replaced.
Definition: associative_set_impl.hh:80
AssociativeSet::numEntries
const int numEntries
Total number of entries, entries are organized in sets of the provided associativity.
Definition: associative_set.hh:128
AssociativeSet::invalidate
void invalidate(Entry *entry)
Invalidate an entry and its respective replacement data.
Definition: associative_set_impl.hh:120
AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::const_iterator
typename std::vector< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::const_iterator const_iterator
Iterator types.
Definition: associative_set.hh:197
TaggedEntry::setSecure
void setSecure(bool s)
Sets the secure value bit.
Definition: associative_set.hh:105
TaggedEntry::invalidate
virtual void invalidate()
Invalidates the entry.
Definition: associative_set.hh:69
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
AssociativeSet::end
iterator end()
Returns an iterator pointing to the end of the the dictionary (placeholder element,...
Definition: associative_set.hh:214
addr
ip6_addr_t addr
Definition: inet.hh:423
BaseIndexingPolicy
A common base class for indexing table locations.
Definition: base.hh:63
AssociativeSet::indexingPolicy
BaseIndexingPolicy *const indexingPolicy
Pointer to the indexing policy.
Definition: associative_set.hh:130
AssociativeSet::replacementPolicy
BaseReplacementPolicy *const replacementPolicy
Pointer to the replacement policy.
Definition: associative_set.hh:132
TaggedEntry::isValid
bool isValid() const
Consult the valid bit.
Definition: associative_set.hh:54
TaggedEntry::setTag
void setTag(Addr t)
Sets the tag of the entry.
Definition: associative_set.hh:87
ArmISA::s
Bitfield< 4 > s
Definition: miscregs_types.hh:556
AssociativeSet::AssociativeSet
AssociativeSet(int assoc, int num_entries, BaseIndexingPolicy *idx_policy, BaseReplacementPolicy *rpl_policy, Entry const &init_value=Entry())
Public constructor.
Definition: associative_set_impl.hh:36
AssociativeSet::begin
const_iterator begin() const
Returns an iterator to the first entry of the dictionary.
Definition: associative_set.hh:223

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17