mem-cache: Handle zero sizes on compression
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Tue, 16 Jun 2020 13:14:46 +0000 (15:14 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Mon, 31 Aug 2020 17:45:43 +0000 (17:45 +0000)
commit53ef7c1e6cca6b355fa63bbdfdd6d94fd660aaac
tree1cca8f881ccee3be3996b4f31925b1a303da2f3d
parent58c7fc72d301d3f9beebab7123c0ce7a29d4f313
mem-cache: Handle zero sizes on compression

The size can be zero in special occasions, which would
generate divisions by zero. This patch expands the
stats to support them. It also fixes the compression
factor calculation in the Multi compressor.

As a side effect, now that zero sizes are handled, allow
the Zero compressor to generate it.

Change-Id: I9f7dee76576b09fdc9bef3e1f3f89be3726dcbd9
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33383
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/cache/compressors/base.cc
src/mem/cache/compressors/multi.cc
src/mem/cache/compressors/zero.hh