gem5  v20.1.0.0
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:
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
129  src_requestor_ID, 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__
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
SectorSubBlk::~SectorSubBlk
~SectorSubBlk()
Definition: sector_blk.hh:65
SectorBlk::_validCounter
uint8_t _validCounter
Counter of the number of valid sub-blocks.
Definition: sector_blk.hh:150
SectorSubBlk::setSecure
void setSecure() override
Set secure bit and inform sector block.
Definition: sector_blk.cc:80
SectorSubBlk::invalidate
void invalidate() override
Invalidate the block and inform sector block.
Definition: sector_blk.cc:87
std::vector< SectorSubBlk * >
SectorBlk::_secureBit
bool _secureBit
Whether sector blk is in secure-space or not.
Definition: sector_blk.hh:161
replaceable_entry.hh
SectorBlk::setTag
void setTag(const Addr tag)
Set tag associated to this block.
Definition: sector_blk.cc:142
SectorBlk::getTag
Addr getTag() const
Get tag associated to this block.
Definition: sector_blk.cc:148
SectorSubBlk::_sectorBlk
SectorBlk * _sectorBlk
Sector block associated to this block.
Definition: sector_blk.hh:54
SectorBlk::blks
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
Definition: sector_blk.hh:167
SectorSubBlk::insert
void insert(const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID) override
Set member variables when a block insertion occurs.
Definition: sector_blk.cc:94
SectorSubBlk::setSectorBlock
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
Definition: sector_blk.cc:42
SectorBlk::invalidateSubBlk
void invalidateSubBlk()
Decrease the number of valid sub-blocks.
Definition: sector_blk.cc:160
SectorSubBlk::getTag
Addr getTag() const
Get tag associated to this block.
Definition: sector_blk.cc:67
SectorBlk::setPosition
void setPosition(const uint32_t set, const uint32_t way) override
Sets the position of the sub-entries, besides its own.
Definition: sector_blk.cc:176
SectorSubBlk::setValid
void setValid() override
Set valid bit and inform sector block.
Definition: sector_blk.cc:73
SectorSubBlk::SectorSubBlk
SectorSubBlk()
Definition: sector_blk.hh:62
SectorSubBlk::operator=
SectorSubBlk & operator=(const SectorSubBlk &)=delete
SectorBlk::operator=
SectorBlk & operator=(const SectorBlk &)=delete
SectorBlk::getNumValid
uint8_t getNumValid() const
Get the number of sub-blocks that have been validated.
Definition: sector_blk.cc:129
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
SectorBlk::isValid
bool isValid() const
Checks that a sector block is valid.
Definition: sector_blk.cc:122
CacheBlk::tag
Addr tag
Data block tag value.
Definition: cache_blk.hh:91
SectorSubBlk::_sectorOffset
int _sectorOffset
The offset of this sub-block in the sector.
Definition: sector_blk.hh:59
SectorBlk::validateSubBlk
void validateSubBlk()
Increase the number of valid sub-blocks.
Definition: sector_blk.cc:154
SectorSubBlk::print
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
Definition: sector_blk.cc:110
SectorBlk::isSecure
bool isSecure() const
Checks that a sector block is secure.
Definition: sector_blk.cc:135
SectorBlk::setSecure
void setSecure()
Set secure bit.
Definition: sector_blk.cc:170
cache_blk.hh
CacheBlk
A Basic Cache block.
Definition: cache_blk.hh:84
SectorSubBlk::setSectorOffset
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
Definition: sector_blk.cc:55
SectorSubBlk::getSectorOffset
int getSectorOffset() const
Get offset of this sub-block within the sector.
Definition: sector_blk.cc:61
SectorBlk::_tag
Addr _tag
Sector tag value.
Definition: sector_blk.hh:156
SectorSubBlk::getSectorBlock
const SectorBlk * getSectorBlock() const
Get sector block associated to this block.
Definition: sector_blk.cc:49
SectorSubBlk
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition: sector_blk.hh:48
SectorBlk
A Basic Sector block.
Definition: sector_blk.hh:143
SectorBlk::~SectorBlk
~SectorBlk()
Definition: sector_blk.hh:167
SectorBlk::SectorBlk
SectorBlk()
Definition: sector_blk.cc:116

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