Daniel Carvalho has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/35700 )
Change subject: mem-cache: Isolate compression bit
......................................................................
mem-cache: Isolate compression bit
The compression bit does not belong with the coherence bits.
Change-Id: I6e9f201a9961b8c6051ba599f051a444d585f0e4
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35700
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/cache/cache_blk.hh
M src/mem/cache/tags/super_blk.cc
M src/mem/cache/tags/super_blk.hh
3 files changed, 18 insertions(+), 8 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved
Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/mem/cache/cache_blk.hh b/src/mem/cache/cache_blk.hh
index 4483fb1..bf9bfe6 100644
--- a/src/mem/cache/cache_blk.hh
+++ b/src/mem/cache/cache_blk.hh
@@ -69,14 +69,12 @@
BlkReadable = 0x04,
/** dirty (modified) */
BlkDirty = 0x08,
- /** block holds compressed data */
- BlkCompressed = 0x80
};
/**
* A Basic Cache block.
- * Contains information regarding its coherence, prefetching and
compression
- * status, as well as a pointer to its data.
+ * Contains information regarding its coherence, prefetching status, as
+ * well as a pointer to its data.
*/
class CacheBlk : public TaggedEntry
{
diff --git a/src/mem/cache/tags/super_blk.cc
b/src/mem/cache/tags/super_blk.cc
index 982d9b0..0f570f9 100644
--- a/src/mem/cache/tags/super_blk.cc
+++ b/src/mem/cache/tags/super_blk.cc
@@ -37,26 +37,26 @@
#include "base/logging.hh"
CompressionBlk::CompressionBlk()
- : SectorSubBlk(), _size(0), _decompressionLatency(0)
+ : SectorSubBlk(), _size(0), _decompressionLatency(0),
_compressed(false)
{
}
bool
CompressionBlk::isCompressed() const
{
- return (status & BlkCompressed) != 0;
+ return _compressed;
}
void
CompressionBlk::setCompressed()
{
- status |= BlkCompressed;
+ _compressed = true;
}
void
CompressionBlk::setUncompressed()
{
- status &= ~BlkCompressed;
+ _compressed = false;
}
std::size_t
@@ -83,6 +83,13 @@
_decompressionLatency = lat;
}
+void
+CompressionBlk::invalidate()
+{
+ SectorSubBlk::invalidate();
+ setUncompressed();
+}
+
std::string
CompressionBlk::print() const
{
diff --git a/src/mem/cache/tags/super_blk.hh
b/src/mem/cache/tags/super_blk.hh
index a1c3ff4..bca3266 100644
--- a/src/mem/cache/tags/super_blk.hh
+++ b/src/mem/cache/tags/super_blk.hh
@@ -59,6 +59,9 @@
*/
Cycles _decompressionLatency;
+ /** Compression bit. */
+ bool _compressed;
+
public:
CompressionBlk();
CompressionBlk(const CompressionBlk&) = delete;
@@ -110,6 +113,8 @@
*/
void setDecompressionLatency(const Cycles lat);
+ void invalidate() override;
+
/**
* Pretty-print sector offset and other CacheBlk information.
*
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35700
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: I6e9f201a9961b8c6051ba599f051a444d585f0e4
Gerrit-Change-Number: 35700
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[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