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
{
#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
_decompressionLatency = lat;
}
+void
+CompressionBlk::invalidate()
+{
+ SectorSubBlk::invalidate();
+ setUncompressed();
+}
+
std::string
CompressionBlk::print() const
{
*/
Cycles _decompressionLatency;
+ /** Compression bit. */
+ bool _compressed;
+
public:
CompressionBlk();
CompressionBlk(const CompressionBlk&) = delete;
*/
void setDecompressionLatency(const Cycles lat);
+ void invalidate() override;
+
/**
* Pretty-print sector offset and other CacheBlk information.
*