gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
41
42namespace gem5
43{
44
45class SectorBlk;
46
51class SectorSubBlk : public CacheBlk
52{
53 protected:
58
63
64 public:
66 SectorSubBlk(const SectorSubBlk&) = delete;
67 using CacheBlk::operator=;
78 SectorSubBlk& operator=(SectorSubBlk&& other) = default;
79 ~SectorSubBlk() = default;
80
86 void setSectorBlock(SectorBlk* sector_blk);
87
94
100 void setSectorOffset(const int sector_offset);
101
107 int getSectorOffset() const;
108
109 Addr getTag() const override;
110
114 void setValid() override;
115
116 void insert(const Addr tag, const bool is_secure) override;
117
121 void invalidate() override;
122
128 std::string print() const override;
129};
130
135class SectorBlk : public TaggedEntry
136{
137 private:
143
144 public:
145 SectorBlk();
146 SectorBlk(const SectorBlk&) = delete;
147 SectorBlk& operator=(const SectorBlk&) = delete;
149
152
158 bool isValid() const override;
159
165 uint8_t getNumValid() const;
166
170 void validateSubBlk();
171
175 void invalidateSubBlk();
176
183 void setPosition(const uint32_t set, const uint32_t way) override;
184
190 std::string print() const override;
191};
192
193} // namespace gem5
194
195#endif //__MEM_CACHE_TAGS_SECTOR_BLK_HH__
Definitions of a simple cache block class.
A Basic Cache block.
Definition cache_blk.hh:72
Addr tag
The entry's tag.
A Basic Sector block.
SectorBlk & operator=(const SectorBlk &)=delete
void invalidateSubBlk()
Decrease the number of valid sub-blocks.
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
bool isValid() const override
Checks that a sector block is valid.
uint8_t getNumValid() const
Get the number of sub-blocks that have been validated.
void setPosition(const uint32_t set, const uint32_t way) override
Sets the position of the sub-entries, besides its own.
uint8_t _validCounter
Counter of the number of valid sub-blocks.
SectorBlk(const SectorBlk &)=delete
void validateSubBlk()
Increase the number of valid sub-blocks.
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition sector_blk.hh:52
~SectorSubBlk()=default
SectorSubBlk(const SectorSubBlk &)=delete
int getSectorOffset() const
Get offset of this sub-block within the sector.
Definition sector_blk.cc:64
SectorBlk * _sectorBlk
Sector block associated to this block.
Definition sector_blk.hh:57
SectorSubBlk & operator=(SectorSubBlk &&other)=default
Move assignment operator.
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
Definition sector_blk.cc:45
SectorSubBlk(SectorSubBlk &&)=delete
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
Definition sector_blk.cc:58
Addr getTag() const override
Get tag associated to this block.
Definition sector_blk.cc:70
void invalidate() override
Invalidate the block and inform sector block.
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
void setValid() override
Set valid bit and inform sector block.
Definition sector_blk.cc:79
SectorSubBlk & operator=(const SectorSubBlk &)=delete
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
int _sectorOffset
The offset of this sub-block in the sector.
Definition sector_blk.hh:62
SectorBlk * getSectorBlock() const
Get sector block associated to this block.
Definition sector_blk.cc:52
A tagged entry is an entry containing a tag.
STL vector class.
Definition stl.hh:37
Bitfield< 12, 11 > set
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0