mem-cache: Rename Encoder namespace as encoder
As part of recent decisions regarding namespace naming conventions, all namespaces will be changed to snake case. compression::Encoder became compression::encoder. Change-Id: I3ff2693fbbfc366952cf0f03414a00debae27635 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45408 Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
This commit is contained in:
committed by
Daniel Carvalho
parent
c84888b67a
commit
2a0e4ae3ea
6
src/mem/cache/compressors/encoders/base.hh
vendored
6
src/mem/cache/compressors/encoders/base.hh
vendored
@@ -36,7 +36,9 @@
|
||||
GEM5_DEPRECATED_NAMESPACE(Compressor, compression);
|
||||
namespace compression
|
||||
{
|
||||
namespace Encoder {
|
||||
GEM5_DEPRECATED_NAMESPACE(Encoder, encoder);
|
||||
namespace encoder
|
||||
{
|
||||
|
||||
struct Code
|
||||
{
|
||||
@@ -77,7 +79,7 @@ class Base
|
||||
virtual uint64_t decode(const uint64_t code) const = 0;
|
||||
};
|
||||
|
||||
} // namespace Encoder
|
||||
} // namespace encoder
|
||||
} // namespace compression
|
||||
|
||||
#endif //__MEM_CACHE_COMPRESSORS_ENCODERS_BASE_HH__
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
GEM5_DEPRECATED_NAMESPACE(Compressor, compression);
|
||||
namespace compression
|
||||
{
|
||||
namespace Encoder {
|
||||
GEM5_DEPRECATED_NAMESPACE(Encoder, encoder);
|
||||
namespace encoder
|
||||
{
|
||||
|
||||
Huffman::Huffman(uint64_t max_code_length)
|
||||
: Base(), maxCodeLength(max_code_length)
|
||||
@@ -132,5 +134,5 @@ Huffman::decode(const uint64_t code) const
|
||||
return it->second;
|
||||
}
|
||||
|
||||
} // namespace Encoder
|
||||
} // namespace encoder
|
||||
} // namespace compression
|
||||
|
||||
@@ -36,12 +36,15 @@
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
#include "base/compiler.hh"
|
||||
#include "mem/cache/compressors/encoders/base.hh"
|
||||
|
||||
GEM5_DEPRECATED_NAMESPACE(Compressor, compression);
|
||||
namespace compression
|
||||
{
|
||||
namespace Encoder {
|
||||
GEM5_DEPRECATED_NAMESPACE(Encoder, encoder);
|
||||
namespace encoder
|
||||
{
|
||||
|
||||
/**
|
||||
* This encoder builds a Huffman tree using the frequency of each value to
|
||||
@@ -176,7 +179,7 @@ class Huffman : public Base
|
||||
void generateCodes(const Node* node, const Code& current_code);
|
||||
};
|
||||
|
||||
} // namespace Encoder
|
||||
} // namespace encoder
|
||||
} // namespace compression
|
||||
|
||||
#endif //__MEM_CACHE_COMPRESSORS_ENCODERS_HUFFMAN_HH__
|
||||
|
||||
4
src/mem/cache/compressors/frequent_values.cc
vendored
4
src/mem/cache/compressors/frequent_values.cc
vendored
@@ -70,7 +70,7 @@ FrequentValues::compress(const std::vector<Chunk>& chunks, Cycles& comp_lat,
|
||||
// Compress every value sequentially. The compressed values are then
|
||||
// added to the final compressed data.
|
||||
for (const auto& chunk : chunks) {
|
||||
Encoder::Code code;
|
||||
encoder::Code code;
|
||||
int length = 0;
|
||||
if (phase == COMPRESSING) {
|
||||
VFTEntry* entry = VFT.findEntry(chunk, false);
|
||||
@@ -144,7 +144,7 @@ FrequentValues::decompress(const CompressionData* comp_data, uint64_t* data)
|
||||
// its corresponding value, in order to make life easier we
|
||||
// search for the value and verify that the stored code
|
||||
// matches the table's
|
||||
GEM5_VAR_USED const Encoder::Code code =
|
||||
GEM5_VAR_USED const encoder::Code code =
|
||||
indexEncoder.encode(comp_chunk.value);
|
||||
|
||||
// Either the value will be found and the codes match, or the
|
||||
|
||||
6
src/mem/cache/compressors/frequent_values.hh
vendored
6
src/mem/cache/compressors/frequent_values.hh
vendored
@@ -82,7 +82,7 @@ class FrequentValues : public Base
|
||||
const bool useHuffmanEncoding;
|
||||
|
||||
/** The encoder applied to the VFT indices. */
|
||||
Encoder::Huffman indexEncoder;
|
||||
encoder::Huffman indexEncoder;
|
||||
|
||||
/** Number of bits in the saturating counters. */
|
||||
const int counterBits;
|
||||
@@ -199,7 +199,7 @@ class FrequentValues::CompData : public CompressionData
|
||||
struct CompressedValue
|
||||
{
|
||||
/** The codeword.*/
|
||||
Encoder::Code code;
|
||||
encoder::Code code;
|
||||
|
||||
/**
|
||||
* Original value, stored both for when the codeword marks an
|
||||
@@ -207,7 +207,7 @@ class FrequentValues::CompData : public CompressionData
|
||||
*/
|
||||
uint64_t value;
|
||||
|
||||
CompressedValue(Encoder::Code _code, uint64_t _value)
|
||||
CompressedValue(encoder::Code _code, uint64_t _value)
|
||||
: code(_code), value(_value)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user