gem5  v21.1.0.2
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 namespace gem5
43 {
44 
45 class SectorBlk;
46 
51 class SectorSubBlk : public CacheBlk
52 {
53  protected:
58 
63 
64  public:
66  SectorSubBlk(const SectorSubBlk&) = delete;
67  SectorSubBlk& operator=(const SectorSubBlk&) = delete;
68  SectorSubBlk(SectorSubBlk&&) = delete;
77  SectorSubBlk& operator=(SectorSubBlk&& other) = default;
78  ~SectorSubBlk() = default;
79 
85  void setSectorBlock(SectorBlk* sector_blk);
86 
92  SectorBlk* getSectorBlock() const;
93 
99  void setSectorOffset(const int sector_offset);
100 
106  int getSectorOffset() const;
107 
108  Addr getTag() const override;
109 
113  void setValid() override;
114 
115  void insert(const Addr tag, const bool is_secure) override;
116 
120  void invalidate() override;
121 
127  std::string print() const override;
128 };
129 
134 class SectorBlk : public TaggedEntry
135 {
136  private:
141  uint8_t _validCounter;
142 
143  public:
144  SectorBlk();
145  SectorBlk(const SectorBlk&) = delete;
146  SectorBlk& operator=(const SectorBlk&) = delete;
148 
151 
157  bool isValid() const override;
158 
164  uint8_t getNumValid() const;
165 
169  void validateSubBlk();
170 
174  void invalidateSubBlk();
175 
182  void setPosition(const uint32_t set, const uint32_t way) override;
183 
189  std::string print() const override;
190 };
191 
192 } // namespace gem5
193 
194 #endif //__MEM_CACHE_TAGS_SECTOR_BLK_HH__
gem5::SectorSubBlk::insert
void insert(const Addr tag, const bool is_secure) override
Insert the block by assigning it a tag and marking it valid.
Definition: sector_blk.cc:86
gem5::SectorBlk::validateSubBlk
void validateSubBlk()
Increase the number of valid sub-blocks.
Definition: sector_blk.cc:133
gem5::SectorSubBlk::setSectorBlock
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
Definition: sector_blk.cc:45
gem5::SectorSubBlk::_sectorBlk
SectorBlk * _sectorBlk
Sector block associated to this block.
Definition: sector_blk.hh:57
gem5::SectorSubBlk::setSectorOffset
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
Definition: sector_blk.cc:58
gem5::SectorSubBlk::~SectorSubBlk
~SectorSubBlk()=default
gem5::SectorBlk::invalidateSubBlk
void invalidateSubBlk()
Decrease the number of valid sub-blocks.
Definition: sector_blk.cc:139
gem5::SectorBlk::SectorBlk
SectorBlk()
Definition: sector_blk.cc:114
gem5::SectorBlk
A Basic Sector block.
Definition: sector_blk.hh:134
std::vector
STL vector class.
Definition: stl.hh:37
gem5::SectorSubBlk::getSectorBlock
SectorBlk * getSectorBlock() const
Get sector block associated to this block.
Definition: sector_blk.cc:52
gem5::SectorBlk::blks
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
Definition: sector_blk.hh:147
gem5::SectorSubBlk::operator=
SectorSubBlk & operator=(const SectorSubBlk &)=delete
gem5::CacheBlk
A Basic Cache block.
Definition: cache_blk.hh:70
replaceable_entry.hh
gem5::SectorSubBlk::setValid
void setValid() override
Set valid bit and inform sector block.
Definition: sector_blk.cc:79
gem5::TaggedEntry
A tagged entry is an entry containing a tag.
Definition: tagged_entry.hh:46
gem5::SectorBlk::~SectorBlk
~SectorBlk()
Definition: sector_blk.hh:147
gem5::SectorSubBlk::_sectorOffset
int _sectorOffset
The offset of this sub-block in the sector.
Definition: sector_blk.hh:62
gem5::SectorSubBlk::getTag
Addr getTag() const override
Get tag associated to this block.
Definition: sector_blk.cc:70
gem5::SectorBlk::operator=
SectorBlk & operator=(const SectorBlk &)=delete
gem5::SectorSubBlk::print
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
Definition: sector_blk.cc:108
gem5::SectorBlk::_validCounter
uint8_t _validCounter
Counter of the number of valid sub-blocks.
Definition: sector_blk.hh:141
gem5::SectorBlk::isValid
bool isValid() const override
Checks that a sector block is valid.
Definition: sector_blk.cc:120
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::SectorSubBlk::SectorSubBlk
SectorSubBlk()
Definition: sector_blk.hh:65
gem5::SectorSubBlk::invalidate
void invalidate() override
Invalidate the block and inform sector block.
Definition: sector_blk.cc:101
cache_blk.hh
gem5::SectorSubBlk
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition: sector_blk.hh:51
gem5::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:149
gem5::SectorSubBlk::getSectorOffset
int getSectorOffset() const
Get offset of this sub-block within the sector.
Definition: sector_blk.cc:64
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::SectorBlk::getNumValid
uint8_t getNumValid() const
Get the number of sub-blocks that have been validated.
Definition: sector_blk.cc:127
gem5::SectorBlk::print
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
Definition: sector_blk.cc:158

Generated on Tue Sep 21 2021 12:25:30 for gem5 by doxygen 1.8.17