gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
super_blk.hh
Go to the documentation of this file.
1 
37 #ifndef __MEM_CACHE_TAGS_SUPER_BLK_HH__
38 #define __MEM_CACHE_TAGS_SUPER_BLK_HH__
39 
41 
42 class SuperBlk;
43 
51 {
52  private:
56  std::size_t _size;
57 
63 
64  public:
66  CompressionBlk(const CompressionBlk&) = delete;
67  CompressionBlk& operator=(const CompressionBlk&) = delete;
69 
75  bool isCompressed() const;
76 
80  void setCompressed();
81 
85  void setUncompressed();
86 
87  /*
88  * Get size, in bits, of this compressed block's data.
89  *
90  * @return The compressed size.
91  */
92  std::size_t getSizeBits() const;
93 
99  void setSizeBits(const std::size_t size);
100 
107 
113  void setDecompressionLatency(const Cycles lat);
114 
120  std::string print() const override;
121 };
122 
127 class SuperBlk : public SectorBlk
128 {
129  protected:
131  std::size_t blkSize;
132 
133  public:
134  SuperBlk() : SectorBlk(), blkSize(0) {}
135  SuperBlk(const SuperBlk&) = delete;
136  SuperBlk& operator=(const SuperBlk&) = delete;
137  ~SuperBlk() {};
138 
146  bool isCompressed(const CompressionBlk* ignored_blk = nullptr) const;
147 
154  bool canCoAllocate(const std::size_t compressed_size) const;
155 
161  void setBlkSize(const std::size_t blk_size);
162 };
163 
164 #endif //__MEM_CACHE_TAGS_SUPER_BLK_HH__
void setDecompressionLatency(const Cycles lat)
Set number of cycles needed to decompress this block.
Definition: super_blk.cc:83
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
CompressionBlk & operator=(const CompressionBlk &)=delete
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
Definition: sector_blk.hh:50
Cycles getDecompressionLatency() const
Get number of cycles needed to decompress this block.
Definition: super_blk.cc:77
void setUncompressed()
Clear compression bit.
Definition: super_blk.cc:59
std::size_t _size
Set size, in bits, of this compressed block's data.
Definition: super_blk.hh:56
void setSizeBits(const std::size_t size)
Set size, in bits, of this compressed block's data.
Definition: super_blk.cc:71
std::size_t getSizeBits() const
Definition: super_blk.cc:65
A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock a...
Definition: super_blk.hh:50
Copyright (c) 2018 Inria All rights reserved.
void setCompressed()
Set compression bit.
Definition: super_blk.cc:53
bool isCompressed() const
Check if this block holds compressed data.
Definition: super_blk.cc:47
Cycles _decompressionLatency
Number of cycles needed to decompress this block.
Definition: super_blk.hh:62
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
Definition: super_blk.cc:89
std::size_t blkSize
Block size, in bytes.
Definition: super_blk.hh:131
A Basic Sector block.
Definition: sector_blk.hh:145
A basic compression superblock.
Definition: super_blk.hh:127

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