gem5  v20.0.0.3
sector_blk.hh
Go to the documentation of this file.
1 
34 #ifndef __MEM_CACHE_TAGS_SECTOR_BLK_HH__
35 #define __MEM_CACHE_TAGS_SECTOR_BLK_HH__
36 
37 #include <vector>
38 
39 #include "mem/cache/cache_blk.hh"
41 
42 class SectorBlk;
43 
48 class SectorSubBlk : public CacheBlk
49 {
50  protected:
55 
60 
61  public:
62  SectorSubBlk() : CacheBlk(), _sectorBlk(nullptr), _sectorOffset(0) {}
63  SectorSubBlk(const SectorSubBlk&) = delete;
64  SectorSubBlk& operator=(const SectorSubBlk&) = delete;
66 
72  void setSectorBlock(SectorBlk* sector_blk);
73 
79  const SectorBlk* getSectorBlock() const;
80 
86  void setSectorOffset(const int sector_offset);
87 
93  int getSectorOffset() const;
94 
100  Addr getTag() const;
101 
105  void setValid() override;
106 
110  void setSecure() override;
111 
115  void invalidate() override;
116 
128  void insert(const Addr tag, const bool is_secure, const int src_master_ID,
129  const uint32_t task_ID) override;
130 
136  std::string print() const override;
137 };
138 
144 {
145  private:
150  uint8_t _validCounter;
151 
152  protected:
157 
162 
163  public:
164  SectorBlk();
165  SectorBlk(const SectorBlk&) = delete;
166  SectorBlk& operator=(const SectorBlk&) = delete;
168 
171 
177  bool isValid() const;
178 
184  uint8_t getNumValid() const;
185 
193  bool isSecure() const;
194 
200  void setTag(const Addr tag);
201 
207  Addr getTag() const;
208 
212  void validateSubBlk();
213 
217  void invalidateSubBlk();
218 
222  void setSecure();
223 
230  void setPosition(const uint32_t set, const uint32_t way) override;
231 };
232 
233 #endif //__MEM_CACHE_TAGS_SECTOR_BLK_HH__
const SectorBlk * getSectorBlock() const
Get sector block associated to this block.
Definition: sector_blk.cc:49
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
Definition: sector_blk.cc:110
bool isValid() const
Checks that a block is valid.
Definition: cache_blk.hh:203
void setValid() override
Set valid bit and inform sector block.
Definition: sector_blk.cc:73
int _sectorOffset
The offset of this sub-block in the sector.
Definition: sector_blk.hh:59
Addr tag
Data block tag value.
Definition: cache_blk.hh:91
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition: sector_blk.hh:48
Addr _tag
Sector tag value.
Definition: sector_blk.hh:156
bool _secureBit
Whether sector blk is in secure-space or not.
Definition: sector_blk.hh:161
void invalidate() override
Invalidate the block and inform sector block.
Definition: sector_blk.cc:87
STL vector class.
Definition: stl.hh:37
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:84
bool isSecure() const
Check if this block holds data from the secure memory space.
Definition: cache_blk.hh:245
SectorBlk * _sectorBlk
Sector block associated to this block.
Definition: sector_blk.hh:54
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
Definition: sector_blk.cc:42
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
Definition: sector_blk.cc:55
int getSectorOffset() const
Get offset of this sub-block within the sector.
Definition: sector_blk.cc:61
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:143
uint8_t _validCounter
Counter of the number of valid sub-blocks.
Definition: sector_blk.hh:150
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:94
void setSecure() override
Set secure bit and inform sector block.
Definition: sector_blk.cc:80
Addr getTag() const
Get tag associated to this block.
Definition: sector_blk.cc:67

Generated on Fri Jul 3 2020 15:53:03 for gem5 by doxygen 1.8.13