// Get secure bit
const bool is_secure = pkt->isSecure();
+ // @todo Compress and get compression related data
+ std::size_t blk_size_bits = blkSize*8;
+
// Find replacement victim
std::vector<CacheBlk*> evict_blks;
- CacheBlk *victim = tags->findVictim(addr, is_secure, evict_blks);
+ CacheBlk *victim = tags->findVictim(addr, is_secure, blk_size_bits,
+ evict_blks);
// It is valid to return nullptr if there is no victim
if (!victim)
#define __MEM_CACHE_TAGS_BASE_HH__
#include <cassert>
+#include <cstdint>
#include <functional>
#include <string>
*
* @param addr Address to find a victim for.
* @param is_secure True if the target memory space is secure.
+ * @param size Size, in bits, of new block to allocate.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
virtual CacheBlk* findVictim(Addr addr, const bool is_secure,
+ const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const = 0;
/**
#ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
#define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
+#include <cstdint>
#include <functional>
#include <string>
#include <vector>
*
* @param addr Address to find a victim for.
* @param is_secure True if the target memory space is secure.
+ * @param size Size, in bits, of new block to allocate.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
+ const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const override
{
// Get possible entries to be victimized
}
CacheBlk*
-FALRU::findVictim(Addr addr, const bool is_secure,
+FALRU::findVictim(Addr addr, const bool is_secure, const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const
{
// The victim is always stored on the tail for the FALRU
*
* @param addr Address to find a victim for.
* @param is_secure True if the target memory space is secure.
+ * @param size Size, in bits, of new block to allocate.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
+ const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const override;
/**
}
CacheBlk*
-SectorTags::findVictim(Addr addr, const bool is_secure,
+SectorTags::findVictim(Addr addr, const bool is_secure, const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const
{
// Get possible entries to be victimized
#ifndef __MEM_CACHE_TAGS_SECTOR_TAGS_HH__
#define __MEM_CACHE_TAGS_SECTOR_TAGS_HH__
+#include <cstdint>
#include <string>
#include <vector>
*
* @param addr Address to find a victim for.
* @param is_secure True if the target memory space is secure.
+ * @param size Size, in bits, of new block to allocate.
* @param evict_blks Cache blocks to be evicted.
* @return Cache block to be replaced.
*/
CacheBlk* findVictim(Addr addr, const bool is_secure,
+ const std::size_t size,
std::vector<CacheBlk*>& evict_blks) const override;
/**