Daniel Carvalho has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/33385 )
Change subject: mem-cache: Make compression size threshold a percentage
......................................................................
mem-cache: Make compression size threshold a percentage
By changing the parameter into a percentage, changing the block
size will automatically reconfigure the size threshold. Also,
change the default percentage to 50% to avoid storing blocks
unlikely to co-allocate in compressed format.
Change-Id: I1458f19db39becc2d40c00269132fea01770016f
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33385
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/cache/compressors/Compressors.py
M src/mem/cache/compressors/base.cc
2 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/mem/cache/compressors/Compressors.py
b/src/mem/cache/compressors/Compressors.py
index 01cb619..9fa06f2 100644
--- a/src/mem/cache/compressors/Compressors.py
+++ b/src/mem/cache/compressors/Compressors.py
@@ -37,9 +37,9 @@
block_size = Param.Int(Parent.cache_line_size, "Block size in bytes")
chunk_size_bits = Param.Unsigned(32,
"Size of a parsing data chunk (in bits)")
- size_threshold = Param.Unsigned(Parent.cache_line_size, "Minimum
size, "
- "in bytes, in which a block must be compressed to. Otherwise it
is "
- "stored in its uncompressed state")
+ size_threshold_percentage = Param.Percent(50,
+ "Minimum percentage of the block size, a compressed block must "
+ "achieve to be stored in compressed format")
class BaseDictionaryCompressor(BaseCacheCompressor):
type = 'BaseDictionaryCompressor'
diff --git a/src/mem/cache/compressors/base.cc
b/src/mem/cache/compressors/base.cc
index 5b96e97..e12e36e 100644
--- a/src/mem/cache/compressors/base.cc
+++ b/src/mem/cache/compressors/base.cc
@@ -77,7 +77,7 @@
Base::Base(const Params *p)
: SimObject(p), blkSize(p->block_size),
chunkSizeBits(p->chunk_size_bits),
- sizeThreshold(p->size_threshold),
+ sizeThreshold((blkSize * p->size_threshold_percentage) / 100),
stats(*this)
{
fatal_if(64 % chunkSizeBits,
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33385
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1458f19db39becc2d40c00269132fea01770016f
Gerrit-Change-Number: 33385
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s