From 8f0efe340bcac14b45f6f781c068f67811b3c273 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Thu, 1 Aug 2019 10:21:15 +0200 Subject: [PATCH] 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 Maintainer: Nikos Nikoleris Tested-by: kokoro --- src/mem/cache/compressors/bdi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/cache/compressors/bdi.cc b/src/mem/cache/compressors/bdi.cc index e29179fc0..a8068c614 100644 --- a/src/mem/cache/compressors/bdi.cc +++ b/src/mem/cache/compressors/bdi.cc @@ -166,7 +166,7 @@ BDI::BDICompDataBaseDelta::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 -- 2.30.2