Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/33383 )
Change subject: mem-cache: Fix multi compressor's CF calculation
......................................................................
mem-cache: Fix multi compressor's CF calculation
The size can be zero in special occasions, which would generate
divisions by zero.
Change-Id: I9f7dee76576b09fdc9bef3e1f3f89be3726dcbd9
Signed-off-by: Daniel R. Carvalho <oda...@yahoo.com.br>
---
M src/mem/cache/compressors/multi.cc
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/mem/cache/compressors/multi.cc
b/src/mem/cache/compressors/multi.cc
index b740a95..3c80715 100644
--- a/src/mem/cache/compressors/multi.cc
+++ b/src/mem/cache/compressors/multi.cc
@@ -91,7 +91,14 @@
: index(index), compData(std::move(comp_data)),
decompLat(decomp_lat)
{
- const std::size_t size = compData->getSize();
+ std::size_t size = compData->getSize();
+ // Some compressors (notably the zero compressor) may rely on
+ // extra information being stored in the tags, or added in
+ // another compression layer. Their size can be 0, so we round
+ // it up to avoid errors.
+ if (size == 0) {
+ size = 1;
+ }
// If the compressed size is worse than the uncompressed size,
// we assume the size is the uncompressed size, and thus the
// compression factor is 1
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33383
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: I9f7dee76576b09fdc9bef3e1f3f89be3726dcbd9
Gerrit-Change-Number: 33383
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s