gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sector_blk.hh
Go to the documentation of this file.
1 
36 #ifndef __MEM_CACHE_TAGS_SECTOR_BLK_HH__
37 #define __MEM_CACHE_TAGS_SECTOR_BLK_HH__
38 
39 #include <vector>
40 
41 #include "mem/cache/cache_blk.hh"
43 
44 class SectorBlk;
45 
50 class SectorSubBlk : public CacheBlk
51 {
52  protected:
57 
62 
63  public:
64  SectorSubBlk() : CacheBlk(), _sectorBlk(nullptr), _sectorOffset(0) {}
65  SectorSubBlk(const SectorSubBlk&) = delete;
66  SectorSubBlk& operator=(const SectorSubBlk&) = delete;
68 
74  void setSectorBlock(SectorBlk* sector_blk);
75 
81  const SectorBlk* getSectorBlock() const;
82 
88  void setSectorOffset(const int sector_offset);
89 
95  int getSectorOffset() const;
96 
102  Addr getTag() const;
103 
107  void setValid() override;
108 
112  void setSecure() override;
113 
117  void invalidate() override;
118 
130  void insert(const Addr tag, const bool is_secure, const int src_master_ID,
131  const uint32_t task_ID) override;
132 
138  std::string print() const override;
139 };
140 
146 {
147  private:
152  uint8_t _validCounter;
153 
154  protected:
159 
164 
165  public:
166  SectorBlk();
167  SectorBlk(const SectorBlk&) = delete;
168  SectorBlk& operator=(const SectorBlk&) = delete;
170 
173 
179  bool isValid() const;
180 
186  uint8_t getNumValid() const;
187 
195  bool isSecure() const;
196 
202  void setTag(const Addr tag);
203 
209  Addr getTag() const;
210 
214  void validateSubBlk();
215 
219  void invalidateSubBlk();
220 
224  void setSecure();
225 
232  void setPosition(const uint32_t set, const uint32_t way) override;
233 };
234 
235 #endif //__MEM_CACHE_TAGS_SECTOR_BLK_HH__
const SectorBlk * getSectorBlock() const
Get sector block associated to this block.
Definition: sector_blk.cc:51
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
Definition: sector_blk.cc:112
bool isValid() const
Checks that a block is valid.
Definition: cache_blk.hh:206
void setValid() override
Set valid bit and inform sector block.
Definition: sector_blk.cc:75
int _sectorOffset
The offset of this sub-block in the sector.
Definition: sector_blk.hh:61
Addr tag
Data block tag value.
Definition: cache_blk.hh:94
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition: sector_blk.hh:50
Addr _tag
Sector tag value.
Definition: sector_blk.hh:158
bool _secureBit
Whether sector blk is in secure-space or not.
Definition: sector_blk.hh:163
void invalidate() override
Invalidate the block and inform sector block.
Definition: sector_blk.cc:89
STL vector class.
Definition: stl.hh:40
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
A Basic Cache block.
Definition: cache_blk.hh:87
bool isSecure() const
Check if this block holds data from the secure memory space.
Definition: cache_blk.hh:248
SectorBlk * _sectorBlk
Sector block associated to this block.
Definition: sector_blk.hh:56
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
Definition: sector_blk.cc:44
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
Definition: sector_blk.cc:57
int getSectorOffset() const
Get offset of this sub-block within the sector.
Definition: sector_blk.cc:63
Definitions of a simple cache block class.
SectorSubBlk & operator=(const SectorSubBlk &)=delete
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
A Basic Sector block.
Definition: sector_blk.hh:145
uint8_t _validCounter
Counter of the number of valid sub-blocks.
Definition: sector_blk.hh:152
void insert(const Addr tag, const bool is_secure, const int src_master_ID, const uint32_t task_ID) override
Set member variables when a block insertion occurs.
Definition: sector_blk.cc:96
void setSecure() override
Set secure bit and inform sector block.
Definition: sector_blk.cc:82
Addr getTag() const
Get tag associated to this block.
Definition: sector_blk.cc:69

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