gem5
v22.1.0.0
|
The compressed data is composed of multiple pattern entries. More...
#include <dictionary_compressor.hh>
Public Member Functions | |
Pattern (const int number, const uint64_t code, const uint64_t metadata_length, const uint64_t num_unmatched_bits, const int match_location, const bool allocate=true) | |
Default constructor. More... | |
virtual | ~Pattern ()=default |
Default destructor. More... | |
int | getPatternNumber () const |
Get enum number associated to this pattern. More... | |
uint8_t | getCode () const |
Get code of this pattern. More... | |
uint8_t | getMatchLocation () const |
Get the index of the dictionary match location. More... | |
virtual std::size_t | getSizeBits () const |
Get size, in bits, of the pattern (excluding prefix). More... | |
bool | shouldAllocate () const |
Determine if pattern allocates a dictionary entry. More... | |
std::string | print () const |
Extract pattern's information to a string. More... | |
virtual DictionaryEntry | decompress (const DictionaryEntry dict_bytes) const =0 |
Decompress the pattern. More... | |
Protected Attributes | |
const int | patternNumber |
Pattern enum number. More... | |
const uint8_t | code |
Code associated to the pattern. More... | |
const uint8_t | length |
Length, in bits, of the code and match location. More... | |
const uint8_t | numUnmatchedBits |
Number of unmatched bits. More... | |
const int | matchLocation |
Index representing the the match location. More... | |
const bool | allocate |
Wether the pattern allocates a dictionary entry or not. More... | |
The compressed data is composed of multiple pattern entries.
To add a new pattern one should inherit from this class and implement isPattern() and decompress(). Then the new pattern must be added to the PatternFactory declaration in crescent order of size (in the DictionaryCompressor class).
Definition at line 286 of file dictionary_compressor.hh.
|
inline |
Default constructor.
number | Pattern number. |
code | Code associated to this pattern. |
metadata_length | Length, in bits, of the code and match location. |
num_unmatched_bits | Number of unmatched bits. |
match_location | Index of the match location. |
Definition at line 317 of file dictionary_compressor.hh.
|
virtualdefault |
Default destructor.
|
pure virtual |
Decompress the pattern.
Each pattern has its own way of interpreting its data.
dict_bytes | The bytes in the corresponding matching entry. |
Implemented in gem5::compression::DictionaryCompressor< T >::SignExtendedPattern< N >, gem5::compression::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >, gem5::compression::DictionaryCompressor< T >::RepeatedValuePattern< RepT >, gem5::compression::DictionaryCompressor< T >::MaskedValuePattern< value, mask >, gem5::compression::DictionaryCompressor< T >::MaskedValuePattern< 0, 0xFFFFFFFFFFFFFFFF >, gem5::compression::DictionaryCompressor< T >::MaskedPattern< mask >, and gem5::compression::DictionaryCompressor< T >::UncompressedPattern.
Referenced by gem5::compression::DictionaryCompressor< T >::decompressValue().
|
inline |
|
inline |
Get the index of the dictionary match location.
Definition at line 348 of file dictionary_compressor.hh.
Referenced by gem5::compression::DictionaryCompressor< T >::decompressValue().
|
inline |
Get enum number associated to this pattern.
Definition at line 334 of file dictionary_compressor.hh.
|
inlinevirtual |
Get size, in bits, of the pattern (excluding prefix).
Corresponds to unmatched_data_size + code_length.
Definition at line 357 of file dictionary_compressor.hh.
|
inline |
Extract pattern's information to a string.
Definition at line 375 of file dictionary_compressor.hh.
References gem5::csprintf().
|
inline |
Determine if pattern allocates a dictionary entry.
Definition at line 367 of file dictionary_compressor.hh.
Referenced by gem5::compression::DictionaryCompressor< T >::decompressValue().
|
protected |
Wether the pattern allocates a dictionary entry or not.
Definition at line 305 of file dictionary_compressor.hh.
|
protected |
Code associated to the pattern.
Definition at line 293 of file dictionary_compressor.hh.
|
protected |
Length, in bits, of the code and match location.
Definition at line 296 of file dictionary_compressor.hh.
|
protected |
Index representing the the match location.
Definition at line 302 of file dictionary_compressor.hh.
|
protected |
Number of unmatched bits.
Definition at line 299 of file dictionary_compressor.hh.
|
protected |
Pattern enum number.
Definition at line 290 of file dictionary_compressor.hh.