diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2018-06-19 17:08:35 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2019-05-08 17:41:09 +0000 |
commit | a39af1f0ac6d324b4c206d4db18c39ea557bb931 (patch) | |
tree | d93356d5b90dbc8ff51c5f051ea9fa68356e8b95 /src/mem/cache/base.hh | |
parent | 77a49860f98a86f467bae242e6c52f6b7150631c (diff) | |
download | gem5-a39af1f0ac6d324b4c206d4db18c39ea557bb931.tar.xz |
mem-cache: Add compression and decompression calls
Add a compressor to the base cache class and compress within
block allocation and decompress on writebacks.
This change does not implement data expansion (fat writes) yet,
nor it adds the compression latency to the block write time.
Change-Id: Ie36db65f7487c9b05ec4aedebc2c7651b4cb4821
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11410
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/base.hh')
-rw-r--r-- | src/mem/cache/base.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh index b995a6e47..02b9e2d2e 100644 --- a/src/mem/cache/base.hh +++ b/src/mem/cache/base.hh @@ -64,6 +64,7 @@ #include "debug/CachePort.hh" #include "enums/Clusivity.hh" #include "mem/cache/cache_blk.hh" +#include "mem/cache/compressors/base.hh" #include "mem/cache/mshr_queue.hh" #include "mem/cache/tags/base.hh" #include "mem/cache/write_queue.hh" @@ -324,6 +325,9 @@ class BaseCache : public ClockedObject /** Tag and data Storage */ BaseTags *tags; + /** Compression method being used. */ + BaseCacheCompressor* compressor; + /** Prefetcher */ BasePrefetcher *prefetcher; @@ -1070,6 +1074,15 @@ class BaseCache : public ClockedObject Addr blk_addr = pkt->getBlockAddr(blkSize); + // If using compression, on evictions the block is decompressed and + // the operation's latency is added to the payload delay. Consume + // that payload delay here, meaning that the data is always stored + // uncompressed in the writebuffer + if (compressor) { + time += pkt->payloadDelay; + pkt->payloadDelay = 0; + } + WriteQueueEntry *wq_entry = writeBuffer.findMatch(blk_addr, pkt->isSecure()); if (wq_entry && !wq_entry->inService) { |