From 73c8c72e40917b3d3ab1643630ee0fc2cb8d0da4 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sun, 5 Apr 2020 23:24:08 +0200 Subject: [PATCH] mem-cache: Fix priority of multi compressor The priority queue comparator orders such that false gives the entry a higher priority. Therefore, if it is desired to make the entry with lowest decompression latency have higher priority, the comparison must be inverted. Can be tested with: MultiCompressor(compressors=[ PerfectCompressor(decompression_latency=1), PerfectCompressor(decompression_latency=2)]) Where it is expected that compressor0 (the one with decomp lat of 1) is always chosen. Change-Id: I44acbf5f51c6e47efdd2a16fba9596935cf2eb69 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28367 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris Tested-by: kokoro --- src/mem/cache/compressors/multi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/cache/compressors/multi.cc b/src/mem/cache/compressors/multi.cc index 599e0591b..fe22f5eb4 100644 --- a/src/mem/cache/compressors/multi.cc +++ b/src/mem/cache/compressors/multi.cc @@ -103,7 +103,7 @@ MultiCompressor::compress(const uint64_t* cache_line, Cycles& comp_lat, if (lhs_cf == rhs_cf) { // When they have similar compressed sizes, give the one // with fastest decompression privilege - return lhs->decompLat < rhs->decompLat; + return lhs->decompLat > rhs->decompLat; } return lhs_cf < rhs_cf; } -- 2.30.2