Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/38635 )

Change subject: mem-cache: Generate error on compression misconfiguration
......................................................................

mem-cache: Generate error on compression misconfiguration

Compressed caches must use the compressed tags, otherwise a
seg fault will be generated. Besides, if no compressor is
assigned; yet compressed tags are used, data is not compressed.

Generate an error for the first case, and a warning for the
second.

Change-Id: Iac5474ed919163ce38a8c4e8efd9727e5b3d8417
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/base.cc
1 file changed, 7 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 5fc3456..3181a0c 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -56,6 +56,7 @@
 #include "mem/cache/mshr.hh"
 #include "mem/cache/prefetch/base.hh"
 #include "mem/cache/queue_entry.hh"
+#include "mem/cache/tags/compressed_tags.hh"
 #include "mem/cache/tags/super_blk.hh"
 #include "params/BaseCache.hh"
 #include "params/WriteAllocator.hh"
@@ -123,6 +124,12 @@
     tags->tagsInit();
     if (prefetcher)
         prefetcher->setCache(this);
+
+    fatal_if(compressor && !dynamic_cast<CompressedTags*>(tags),
+        "The tags of compressed cache %s must derive from CompressedTags",
+        name());
+    warn_if(!compressor && dynamic_cast<CompressedTags*>(tags),
+ "Compressed cache %s does not have a compression algorithm", name());
     if (compressor)
         compressor->setCache(this);
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38635
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: Iac5474ed919163ce38a8c4e8efd9727e5b3d8417
Gerrit-Change-Number: 38635
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to