gem5
v20.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... | |
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 280 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 311 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 Compressor::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits >, Compressor::DictionaryCompressor< T >::RepeatedValuePattern< RepT >, Compressor::DictionaryCompressor< T >::MaskedValuePattern< value, mask >, Compressor::DictionaryCompressor< T >::MaskedValuePattern< 0, 0xFFFFFFFFFFFFFFFF >, Compressor::DictionaryCompressor< T >::MaskedPattern< mask >, and Compressor::DictionaryCompressor< T >::UncompressedPattern.
|
inline |
|
inline |
Get the index of the dictionary match location.
Definition at line 342 of file dictionary_compressor.hh.
|
inline |
Get enum number associated to this pattern.
Definition at line 328 of file dictionary_compressor.hh.
|
inline |
Get size, in bits, of the pattern (excluding prefix).
Corresponds to unmatched_data_size + code_length.
Definition at line 351 of file dictionary_compressor.hh.
References length.
|
inline |
Extract pattern's information to a string.
Definition at line 369 of file dictionary_compressor.hh.
References csprintf().
|
inline |
Determine if pattern allocates a dictionary entry.
Definition at line 361 of file dictionary_compressor.hh.
|
protected |
Wether the pattern allocates a dictionary entry or not.
Definition at line 299 of file dictionary_compressor.hh.
|
protected |
Code associated to the pattern.
Definition at line 287 of file dictionary_compressor.hh.
|
protected |
Length, in bits, of the code and match location.
Definition at line 290 of file dictionary_compressor.hh.
|
protected |
Index representing the the match location.
Definition at line 296 of file dictionary_compressor.hh.
|
protected |
Number of unmatched bits.
Definition at line 293 of file dictionary_compressor.hh.
|
protected |
Pattern enum number.
Definition at line 284 of file dictionary_compressor.hh.