Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/45407 )
Change subject: mem-cache: Rename encoder variables as indexEncoder
......................................................................
mem-cache: Rename encoder variables as indexEncoder
Pave the way for an encoder namespace.
Change-Id: I5b55ac18a2973e25e53b097cd407861f5f60d646
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/compressors/frequent_values.cc
M src/mem/cache/compressors/frequent_values.hh
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/mem/cache/compressors/frequent_values.cc
b/src/mem/cache/compressors/frequent_values.cc
index 2615076..e41be12 100644
--- a/src/mem/cache/compressors/frequent_values.cc
+++ b/src/mem/cache/compressors/frequent_values.cc
@@ -42,7 +42,7 @@
FrequentValues::FrequentValues(const Params &p)
: Base(p), useHuffmanEncoding(p.max_code_length != 0),
- encoder(p.max_code_length), counterBits(p.counter_bits),
+ indexEncoder(p.max_code_length), counterBits(p.counter_bits),
codeGenerationTicks(p.code_generation_ticks),
checkSaturation(p.check_saturation), numVFTEntries(p.vft_entries),
numSamples(p.num_samples), takenSamples(0), phase(SAMPLING),
@@ -80,14 +80,14 @@
// If using an index encoder, apply it
if (useHuffmanEncoding) {
- code = encoder.encode(index);
+ code = indexEncoder.encode(index);
if (index == uncompressed_index) {
code.length += chunkSizeBits;
} else if (code.length > 64) {
// If, for some reason, we could not generate an
encoding
// for the value, generate the uncompressed encoding
- code = encoder.encode(uncompressed_index);
+ code = indexEncoder.encode(uncompressed_index);
assert(code.length <= 64);
code.length += chunkSizeBits;
}
@@ -142,14 +142,14 @@
// search for the value and verify that the stored code
// matches the table's
GEM5_VAR_USED const Encoder::Code code =
- encoder.encode(comp_chunk.value);
+ indexEncoder.encode(comp_chunk.value);
// Either the value will be found and the codes match, or
the
// value will not be found because it is an uncompressed
entry
assert(((code.length <= 64) &&
(code.code == comp_chunk.code.code)) ||
(comp_chunk.code.code ==
- encoder.encode(uncompressedValue).code));
+ indexEncoder.encode(uncompressedValue).code));
} else {
// The value at the given VFT entry must match the one
stored,
// if it is not the uncompressed value
@@ -236,15 +236,15 @@
// They are sorted such that the value with highest frequency is
// the queue's top
for (const auto& entry : VFT) {
- encoder.sample(entry.value, entry.counter);
+ indexEncoder.sample(entry.value, entry.counter);
}
// Insert the uncompressed value in the tree assuming it has the
// highest frequency, since it is in fact a group of all the values
// not present in the VFT
- encoder.sample(uncompressedValue, ULLONG_MAX);
+ indexEncoder.sample(uncompressedValue, ULLONG_MAX);
- encoder.generateCodeMaps();
+ indexEncoder.generateCodeMaps();
}
// Generate the code map and mark the current phase as code generation
diff --git a/src/mem/cache/compressors/frequent_values.hh
b/src/mem/cache/compressors/frequent_values.hh
index 1a7530a..2788583 100644
--- a/src/mem/cache/compressors/frequent_values.hh
+++ b/src/mem/cache/compressors/frequent_values.hh
@@ -80,7 +80,7 @@
const bool useHuffmanEncoding;
/** The encoder applied to the VFT indices. */
- Encoder::Huffman encoder;
+ Encoder::Huffman indexEncoder;
/** Number of bits in the saturating counters. */
const int counterBits;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45407
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5b55ac18a2973e25e53b097cd407861f5f60d646
Gerrit-Change-Number: 45407
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s