mem-cache: Fix BDI size calculation

The bitmask field indicates to which base a delta refers, and in
the original paper it is fixed and proportional to the highest
number of bases allowed in the compressed data.

Change-Id: I271bf2e19e0765de52b933eaf6d4fcc2ce25d185
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19748
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2019-08-01 10:21:15 +02:00
committed by Daniel Carvalho
parent 28c8fa0454
commit 8f0efe340b

View File

@@ -166,7 +166,7 @@ BDI::BDICompDataBaseDelta<TB, TD>::calculateCompressedSize()
std::size_t size = encodingBits;
// Number of bits used by BitMask
size += bitMask.size()*std::ceil(std::log2(bases.size()));
size += bitMask.size()*std::ceil(std::log2(maxNumBases));
// Number of bits used by Bases. bases[0] is implicit in a hardware
// implementation, therefore its size is 0