From: Daniel R. Carvalho Date: Fri, 25 Oct 2019 16:30:10 +0000 (+0200) Subject: mem-cache: Do not try to compress dataless packets X-Git-Tag: v19.0.0.0~386 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c5ef2d999d439a0313bb60e42a6fe6133c59038;p=gem5.git mem-cache: Do not try to compress dataless packets Fix filling blocks so that packets that do not contain data do not generate a compression attempt. This can happen, for example, with invalidation responses, which will trigger a packet data access assertion. Change-Id: I2a1e7983657f6e5e770b148ab62c9de9ac3986ac Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22164 Reviewed-by: Nikos Nikoleris Reviewed-by: Jason Lowe-Power Maintainer: Nikos Nikoleris Tested-by: kokoro --- diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index fcf03741c..ebfb09275 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -1413,7 +1413,7 @@ BaseCache::allocateBlock(const PacketPtr pkt, PacketList &writebacks) // compressor is used, the compression/decompression methods are called to // calculate the amount of extra cycles needed to read or write compressed // blocks. - if (compressor) { + if (compressor && pkt->hasData()) { compressor->compress(pkt->getConstPtr(), compression_lat, decompression_lat, blk_size_bits); }