summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2019-10-25 18:30:10 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2019-10-29 21:32:02 +0000
commit0c5ef2d999d439a0313bb60e42a6fe6133c59038 (patch)
treeb07d95945bec9d6fe2da445deddc80f22f76dc02
parentcdc4a3cf1496c6c3bd8619ac7970a6090e38d305 (diff)
downloadgem5-0c5ef2d999d439a0313bb60e42a6fe6133c59038.tar.xz
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 <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22164 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r--src/mem/cache/base.cc2
1 files changed, 1 insertions, 1 deletions
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<uint64_t>(), compression_lat,
decompression_lat, blk_size_bits);
}