From: Daniel R. Carvalho Date: Wed, 10 Jun 2020 15:20:59 +0000 (+0200) Subject: mem-cache: Add an extra decomp lat to multi compressor X-Git-Tag: v20.1.0.0~184 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58c7fc72d301d3f9beebab7123c0ce7a29d4f313;p=gem5.git mem-cache: Add an extra decomp lat to multi compressor There is extra hardware required when dealing with multi compressors. As such, add a parameter to allowing increasing their decompression latency to account for any extra delay. Change-Id: I153e4c5ab6927ac092e2ebd767fe88974597bb20 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33382 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris Tested-by: kokoro --- diff --git a/src/mem/cache/compressors/Compressors.py b/src/mem/cache/compressors/Compressors.py index 45effe905..01cb61975 100644 --- a/src/mem/cache/compressors/Compressors.py +++ b/src/mem/cache/compressors/Compressors.py @@ -116,6 +116,8 @@ class MultiCompressor(BaseCacheCompressor): encoding_in_tags = Param.Bool(False, "If set the bits to inform which " "sub-compressor compressed some data are added to its corresponding " "tag entry.") + extra_decomp_lat = Param.Unsigned(0, "Extra latency to be added to the " + "sub-compressor's decompression latency") class PerfectCompressor(BaseCacheCompressor): type = 'PerfectCompressor' diff --git a/src/mem/cache/compressors/multi.cc b/src/mem/cache/compressors/multi.cc index bb98dcd54..b740a956e 100644 --- a/src/mem/cache/compressors/multi.cc +++ b/src/mem/cache/compressors/multi.cc @@ -61,6 +61,7 @@ Multi::Multi(const Params *p) : Base(p), compressors(p->compressors), numEncodingBits(p->encoding_in_tags ? 0 : std::log2(alignToPowerOfTwo(compressors.size()))), + extraDecompressionLatency(p->extra_decomp_lat), multiStats(stats, *this) { fatal_if(compressors.size() == 0, "There must be at least one compressor"); @@ -145,7 +146,7 @@ Multi::compress(const std::vector& chunks, Cycles& comp_lat, DPRINTF(CacheComp, "Best compressor: %d\n", best_index); // Set decompression latency of the best compressor - decomp_lat = results.top()->decompLat; + decomp_lat = results.top()->decompLat + extraDecompressionLatency; // Update compressor ranking stats for (int rank = 0; rank < compressors.size(); rank++) { diff --git a/src/mem/cache/compressors/multi.hh b/src/mem/cache/compressors/multi.hh index 868682feb..fe952d522 100644 --- a/src/mem/cache/compressors/multi.hh +++ b/src/mem/cache/compressors/multi.hh @@ -75,6 +75,13 @@ class Multi : public Base */ const std::size_t numEncodingBits; + /** + * Extra decompression latency to be added to the sub-compressor's + * decompression latency. This can different from zero due to decoding, + * shifting, or packaging, for example. + */ + const Cycles extraDecompressionLatency; + struct MultiStats : public Stats::Group { const Multi& compressor;