35 #ifndef __MEM_CACHE_TAGS_SUPER_BLK_HH__
36 #define __MEM_CACHE_TAGS_SUPER_BLK_HH__
163 std::string
print()
const override;
243 std::string
print()
const override;
A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock a...
CompressionBlk(const CompressionBlk &)=delete
void setCompressed()
Set compression bit.
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
std::size_t getSizeBits() const
void setUncompressed()
Clear compression bit.
void setSizeBits(const std::size_t size)
Set size, in bits, of this compressed block's data.
bool isCompressed() const
Check if this block holds compressed data.
Cycles _decompressionLatency
Number of cycles needed to decompress this block.
std::size_t _size
Set size, in bits, of this compressed block's data.
void setDecompressionLatency(const Cycles lat)
Set number of cycles needed to decompress this block.
CompressionBlk & operator=(const CompressionBlk &)=delete
OverwriteType
When an overwrite happens, the data size may change an not fit in its current container any longer.
@ UNCHANGED
New and old contents are considered of similar sizes.
@ DATA_EXPANSION
New data contents are considered larger than previous contents.
@ DATA_CONTRACTION
New data contents are considered smaller than previous contents.
Cycles getDecompressionLatency() const
Get number of cycles needed to decompress this block.
~CompressionBlk()=default
OverwriteType checkExpansionContraction(const std::size_t size) const
Determines if changing the size of the block will cause a data expansion (new size is bigger) or cont...
CompressionBlk(CompressionBlk &&)=delete
void invalidate() override
Invalidate the block and inform sector block.
bool _compressed
Compression bit.
Cycles is a wrapper class for representing cycle counts, i.e.
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
A basic compression superblock.
std::size_t blkSize
Block size, in bytes.
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
SuperBlk(const SuperBlk &)=delete
SuperBlk & operator=(const SuperBlk &)=delete
void setCompressionFactor(const uint8_t compression_factor)
Set the compression factor of this superblock.
bool isCompressed(const CompressionBlk *ignored_blk=nullptr) const
Returns whether the superblock contains compressed blocks or not.
void setBlkSize(const std::size_t blk_size)
Set block size.
void invalidate() override
Invalidate the block.
bool canCoAllocate(const std::size_t compressed_size) const
Checks whether a superblock can co-allocate given compressed data block.
uint8_t compressionFactor
Superblock's compression factor.
uint8_t calculateCompressionFactor(const std::size_t size) const
Calculate the compression factor (cf) given a compressed size and the maximum compression ratio.
uint8_t getCompressionFactor() const
Get the compression factor of this superblock.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Copyright (c) 2018, 2020 Inria All rights reserved.