diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2019-09-12 17:11:54 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2019-10-29 21:32:02 +0000 |
commit | 7244788c02ef69f8c313f0714f0d5b8f2918222d (patch) | |
tree | 9d99263bd6caf156ef5d4d1f5f80f88690e82919 | |
parent | 2dd82da9b8275fab6235e2e6ff4859978a225db4 (diff) | |
download | gem5-7244788c02ef69f8c313f0714f0d5b8f2918222d.tar.xz |
mem-cache: Inform unused bits instead of bytes in compressor pattern
Increase pattern precision by giving the number of unmatched bits
instead of bytes.
Change-Id: I5efbe9c31672cc973b4c89c741cdc8cc28d26285
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21152
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r-- | src/mem/cache/compressors/dictionary_compressor.hh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mem/cache/compressors/dictionary_compressor.hh b/src/mem/cache/compressors/dictionary_compressor.hh index b519bb466..6922715fd 100644 --- a/src/mem/cache/compressors/dictionary_compressor.hh +++ b/src/mem/cache/compressors/dictionary_compressor.hh @@ -272,8 +272,8 @@ class DictionaryCompressor<T>::Pattern /** Length, in bits, of the code and match location. */ const uint8_t length; - /** Number of unmatched bytes. */ - const uint8_t numUnmatchedBytes; + /** Number of unmatched bits. */ + const uint8_t numUnmatchedBits; /** Index representing the the match location. */ const int matchLocation; @@ -288,14 +288,14 @@ class DictionaryCompressor<T>::Pattern * @param number Pattern number. * @param code Code associated to this pattern. * @param metadata_length Length, in bits, of the code and match location. - * @param num_unmatched_bytes Number of unmatched bytes. + * @param num_unmatched_bits Number of unmatched bits. * @param match_location Index of the match location. */ Pattern(const int number, const uint64_t code, - const uint64_t metadata_length, const uint64_t num_unmatched_bytes, + const uint64_t metadata_length, const uint64_t num_unmatched_bits, const int match_location, const bool allocate = true) : patternNumber(number), code(code), length(metadata_length), - numUnmatchedBytes(num_unmatched_bytes), + numUnmatchedBits(num_unmatched_bits), matchLocation(match_location), allocate(allocate) { } @@ -333,7 +333,7 @@ class DictionaryCompressor<T>::Pattern std::size_t getSizeBits() const { - return numUnmatchedBytes*CHAR_BIT + length; + return numUnmatchedBits + length; } /** @@ -404,7 +404,7 @@ class DictionaryCompressor<T>::UncompressedPattern const int match_location, const DictionaryEntry bytes) : DictionaryCompressor<T>::Pattern(number, code, metadata_length, - sizeof(T), match_location, true), + sizeof(T) * 8, match_location, true), data(bytes) { } @@ -456,7 +456,7 @@ class DictionaryCompressor<T>::MaskedPattern const DictionaryEntry bytes, const bool allocate = true) : DictionaryCompressor<T>::Pattern(number, code, metadata_length, - popCount(~mask) / 8, match_location, allocate), + popCount(~mask), match_location, allocate), bits(DictionaryCompressor<T>::fromDictionaryEntry(bytes) & ~mask) { } |