From 0c5ef2d999d439a0313bb60e42a6fe6133c59038 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Fri, 25 Oct 2019 18:30:10 +0200 Subject: [PATCH] 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 --- src/mem/cache/base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.30.2