gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
Compressor::DictionaryCompressor< T >::Pattern Class Referenceabstract

The compressed data is composed of multiple pattern entries. More...

#include <dictionary_compressor.hh>

Inheritance diagram for Compressor::DictionaryCompressor< T >::Pattern:
Compressor::DictionaryCompressor< T >::DeltaPattern< DeltaSizeBits > Compressor::DictionaryCompressor< T >::MaskedPattern< mask > Compressor::DictionaryCompressor< T >::RepeatedValuePattern< RepT > Compressor::DictionaryCompressor< T >::UncompressedPattern Compressor::DictionaryCompressor< T >::LocatedMaskedPattern< mask, location > Compressor::DictionaryCompressor< T >::MaskedValuePattern< value, mask > Compressor::DictionaryCompressor< T >::LocatedMaskedPattern< 0xFFFFFFFFFFFFFFFF, 0 > Compressor::DictionaryCompressor< T >::MaskedValuePattern< 0, 0xFFFFFFFFFFFFFFFF > Compressor::BaseDelta< BaseType, DeltaSizeBits >::PatternX Compressor::RepeatedQwords::PatternX Compressor::Zero::PatternX Compressor::RepeatedQwords::PatternM Compressor::Zero::PatternZ

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...
 

Detailed Description

template<class T>
class Compressor::DictionaryCompressor< T >::Pattern

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.

Constructor & Destructor Documentation

◆ Pattern()

template<class T >
Compressor::DictionaryCompressor< T >::Pattern::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 
)
inline

Default constructor.

Parameters
numberPattern number.
codeCode associated to this pattern.
metadata_lengthLength, in bits, of the code and match location.
num_unmatched_bitsNumber of unmatched bits.
match_locationIndex of the match location.

Definition at line 311 of file dictionary_compressor.hh.

◆ ~Pattern()

template<class T >
virtual Compressor::DictionaryCompressor< T >::Pattern::~Pattern ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ decompress()

template<class T >
virtual DictionaryEntry Compressor::DictionaryCompressor< T >::Pattern::decompress ( const DictionaryEntry  dict_bytes) const
pure virtual

◆ getCode()

template<class T >
uint8_t Compressor::DictionaryCompressor< T >::Pattern::getCode ( ) const
inline

Get code of this pattern.

Returns
The code.

Definition at line 335 of file dictionary_compressor.hh.

◆ getMatchLocation()

template<class T >
uint8_t Compressor::DictionaryCompressor< T >::Pattern::getMatchLocation ( ) const
inline

Get the index of the dictionary match location.

Returns
The index of the match location.

Definition at line 342 of file dictionary_compressor.hh.

◆ getPatternNumber()

template<class T >
int Compressor::DictionaryCompressor< T >::Pattern::getPatternNumber ( ) const
inline

Get enum number associated to this pattern.

Returns
The pattern enum number.

Definition at line 328 of file dictionary_compressor.hh.

◆ getSizeBits()

template<class T >
std::size_t Compressor::DictionaryCompressor< T >::Pattern::getSizeBits ( ) const
inline

Get size, in bits, of the pattern (excluding prefix).

Corresponds to unmatched_data_size + code_length.

Returns
The size.

Definition at line 351 of file dictionary_compressor.hh.

References length.

◆ print()

template<class T >
std::string Compressor::DictionaryCompressor< T >::Pattern::print ( ) const
inline

Extract pattern's information to a string.

Returns
A string containing the relevant pattern metadata.

Definition at line 369 of file dictionary_compressor.hh.

References csprintf().

◆ shouldAllocate()

template<class T >
bool Compressor::DictionaryCompressor< T >::Pattern::shouldAllocate ( ) const
inline

Determine if pattern allocates a dictionary entry.

Returns
True if should allocate a dictionary entry.

Definition at line 361 of file dictionary_compressor.hh.

Member Data Documentation

◆ allocate

template<class T >
const bool Compressor::DictionaryCompressor< T >::Pattern::allocate
protected

Wether the pattern allocates a dictionary entry or not.

Definition at line 299 of file dictionary_compressor.hh.

◆ code

template<class T >
const uint8_t Compressor::DictionaryCompressor< T >::Pattern::code
protected

Code associated to the pattern.

Definition at line 287 of file dictionary_compressor.hh.

◆ length

template<class T >
const uint8_t Compressor::DictionaryCompressor< T >::Pattern::length
protected

Length, in bits, of the code and match location.

Definition at line 290 of file dictionary_compressor.hh.

◆ matchLocation

template<class T >
const int Compressor::DictionaryCompressor< T >::Pattern::matchLocation
protected

Index representing the the match location.

Definition at line 296 of file dictionary_compressor.hh.

◆ numUnmatchedBits

template<class T >
const uint8_t Compressor::DictionaryCompressor< T >::Pattern::numUnmatchedBits
protected

Number of unmatched bits.

Definition at line 293 of file dictionary_compressor.hh.

◆ patternNumber

template<class T >
const int Compressor::DictionaryCompressor< T >::Pattern::patternNumber
protected

Pattern enum number.

Definition at line 284 of file dictionary_compressor.hh.


The documentation for this class was generated from the following file:

Generated on Wed Sep 30 2020 14:02:39 for gem5 by doxygen 1.8.17