Set and way of sub-entries were not being set previously.
They must be set after the sub-blocks have been assigned
to the main block.
Change-Id: I7b6921b8437b29c472d691cd78cf20f2bb6c7e07
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19669
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
* @param set The set of this entry.
* @param way The way of this entry.
*/
- void setPosition(const uint32_t set, const uint32_t way) {
+ virtual void
+ setPosition(const uint32_t set, const uint32_t way)
+ {
_set = set;
_way = way;
}
// allocation conditions
superblock->setBlkSize(blkSize);
- // Link block to indexing policy
- indexingPolicy->setEntry(superblock, superblock_index);
-
// Associate a replacement data entry to the block
superblock->replacementData = replacementPolicy->instantiateEntry();
// Update block index
++blk_index;
}
+
+ // Link block to indexing policy
+ indexingPolicy->setEntry(superblock, superblock_index);
}
}
{
_secureBit = true;
}
+
+void
+SectorBlk::setPosition(const uint32_t set, const uint32_t way)
+{
+ ReplaceableEntry::setPosition(set, way);
+ for (auto& blk : blks) {
+ blk->setPosition(set, way);
+ }
+}
* Set secure bit.
*/
void setSecure();
+
+ /**
+ * Sets the position of the sub-entries, besides its own.
+ *
+ * @param set The set of this entry and sub-entries.
+ * @param way The way of this entry and sub-entries.
+ */
+ void setPosition(const uint32_t set, const uint32_t way) override;
};
#endif //__MEM_CACHE_TAGS_SECTOR_BLK_HH__
// Locate next cache sector
SectorBlk* sec_blk = &secBlks[sec_blk_index];
- // Link block to indexing policy
- indexingPolicy->setEntry(sec_blk, sec_blk_index);
-
// Associate a replacement data entry to the sector
sec_blk->replacementData = replacementPolicy->instantiateEntry();
// Update block index
++blk_index;
}
+
+ // Link block to indexing policy
+ indexingPolicy->setEntry(sec_blk, sec_blk_index);
}
}