summaryrefslogtreecommitdiff
path: root/src/mem/cache/tags/sector_tags.cc
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-06-21 16:57:37 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-10-10 18:17:42 +0000
commit99a6c94e58b6375c0d524530cab2a27b6ea0f2bc (patch)
tree1324e834457a7bd6149802caa53cfbf9b98529dd /src/mem/cache/tags/sector_tags.cc
parent86a54d91936b524c0ef0f282959f0fc29bafe7eb (diff)
downloadgem5-99a6c94e58b6375c0d524530cab2a27b6ea0f2bc.tar.xz
mem-cache: Create tags initialization function
Having the blocks initialized in the constructor makes it harder to apply inheritance in the tags classes. This patch decouples the block initialization functionality from the constructor by using an init() function. It also sets the parent cache. Change-Id: I0da7fdaae492b1177c7cc3bda8639f79921fbbeb Reviewed-on: https://gem5-review.googlesource.com/c/11509 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem/cache/tags/sector_tags.cc')
-rw-r--r--src/mem/cache/tags/sector_tags.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc
index 76034e1ea..988fda540 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -67,6 +67,13 @@ SectorTags::SectorTags(const SectorTagsParams *p)
fatal_if(!isPowerOf2(numBlocksPerSector),
"# of blocks per sector must be non-zero and a power of 2");
fatal_if(assoc <= 0, "associativity must be greater than zero");
+}
+
+void
+SectorTags::init(BaseCache* cache)
+{
+ // Set parent cache
+ setCache(cache);
// Initialize all sets
unsigned sec_blk_index = 0; // index into sector blks array