Daniel Carvalho has submitted this change. (
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]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45407
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Hoa Nguyen <[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(-)
Approvals:
Hoa Nguyen: Looks good to me, approved
Jason Lowe-Power: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/mem/cache/compressors/frequent_values.cc
b/src/mem/cache/compressors/frequent_values.cc
index 7e9970d..a44c179 100644
--- a/src/mem/cache/compressors/frequent_values.cc
+++ b/src/mem/cache/compressors/frequent_values.cc
@@ -45,7 +45,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),
@@ -83,14 +83,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;
}
@@ -145,14 +145,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
@@ -239,15 +239,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 8292f14..e618dbc 100644
--- a/src/mem/cache/compressors/frequent_values.hh
+++ b/src/mem/cache/compressors/frequent_values.hh
@@ -82,7 +82,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;
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
--
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: 10
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Hoa Nguyen <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s