Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/11104
Change subject: mem-cache: Create CacheComp debug flag
......................................................................
mem-cache: Create CacheComp debug flag
Create a debug flag for cache compression.
Change-Id: Id4b8e86d658d3aa550906ee0f8da3b54f4cdab7d
---
M src/mem/cache/SConscript
M src/mem/cache/compressors/base.cc
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/mem/cache/SConscript b/src/mem/cache/SConscript
index 0cb0679..cec33b8 100644
--- a/src/mem/cache/SConscript
+++ b/src/mem/cache/SConscript
@@ -44,6 +44,7 @@
Source('write_queue_entry.cc')
DebugFlag('Cache')
+DebugFlag('CacheComp')
DebugFlag('CachePort')
DebugFlag('CacheRepl')
DebugFlag('CacheTags')
@@ -53,6 +54,6 @@
# CacheTags is so outrageously verbose, printing the cache's entire tag
# array on each timing access, that you should probably have to ask for
# it explicitly even above and beyond CacheAll.
-CompoundFlag('CacheAll',
['Cache', 'CachePort', 'CacheRepl', 'CacheVerbose',
- 'HWPrefetch'])
+CompoundFlag('CacheAll', ['Cache', 'CacheComp', 'CachePort', 'CacheRepl',
+ 'CacheVerbose', 'HWPrefetch'])
diff --git a/src/mem/cache/compressors/base.cc
b/src/mem/cache/compressors/base.cc
index 0513119..ba35dfc 100644
--- a/src/mem/cache/compressors/base.cc
+++ b/src/mem/cache/compressors/base.cc
@@ -37,6 +37,7 @@
#include <algorithm>
#include <cstdint>
+#include "debug/CacheComp.hh"
#include "params/BaseCacheCompressor.hh"
CompressionData::CompressionData(std::size_t line_size,
@@ -67,7 +68,7 @@
#ifdef DEBUG_COMPRESSION
bool
-matchLine(uint8_t* cache_line) const
+CompressionData::matchLine(uint8_t* cache_line) const
{
return std::memcmp(_cacheLine.data(), cache_line, lineSize) == 0;
}
@@ -91,6 +92,9 @@
// Update stats
compressionSize[std::ceil(std::log2(compressed_size))]++;
+ // Print debug information
+ DPRINTF(CacheComp, "Compressed cache line to %d bits\n",
compressed_size);
+
return compression_data;
}
--
To view, visit https://gem5-review.googlesource.com/11104
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Id4b8e86d658d3aa550906ee0f8da3b54f4cdab7d
Gerrit-Change-Number: 11104
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev