* Declaration of a fully associative LRU tag store.
*/
-#ifndef __FA_LRU_HH__
-#define __FA_LRU_HH__
+#ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
+#define __MEM_CACHE_TAGS_FA_LRU_HH__
#include <list>
-#include "mem/cache/blk.hh"
-#include "mem/packet.hh"
#include "base/hashmap.hh"
+#include "mem/cache/blk.hh"
#include "mem/cache/tags/base.hh"
+#include "mem/packet.hh"
/**
* A fully associative cache block.
typedef FALRUBlk BlkType;
/** Typedef a list of pointers to the local block type. */
typedef std::list<FALRUBlk*> BlkList;
+
protected:
/** The block size of the cache. */
- const int blkSize;
+ const unsigned blkSize;
/** The size of the cache. */
- const int size;
- /** The number of blocks in the cache. */
- const int numBlks; // calculated internally
+ const unsigned size;
/** The hit latency of the cache. */
- const int hitLatency;
+ const unsigned hitLatency;
/** Array of pointers to blocks at the cache size boundaries. */
FALRUBlk **cacheBoundaries;
/** A mask for the FALRUBlk::inCache bits. */
int cacheMask;
/** The number of different size caches being tracked. */
- int numCaches;
+ unsigned numCaches;
/** The cache blocks. */
FALRUBlk *blks;
* @param size The size of the cache.
* @param hit_latency The hit latency of the cache.
*/
- FALRU(int blkSize, int size, int hit_latency);
+ FALRU(unsigned blkSize, unsigned size, unsigned hit_latency);
/**
* Register the stats for this object.
* @param inCache The FALRUBlk::inCache flags.
* @return Pointer to the cache block.
*/
- FALRUBlk* accessBlock(Addr addr, int &lat, int *inCache = 0);
+ FALRUBlk* accessBlock(Addr addr, int &lat, int context_src, int *inCache = 0);
/**
* Find the block in the cache, do not update the replacement data.
*/
FALRUBlk* findVictim(Addr addr, PacketList & writebacks);
- void insertBlock(Addr addr, BlkType *blk);
+ void insertBlock(Addr addr, BlkType *blk, int context_src);
/**
* Return the hit latency of this cache.
* Return the block size of this cache.
* @return The block size.
*/
- int getBlockSize()
+ unsigned
+ getBlockSize() const
{
return blkSize;
}
* Return the subblock size of this cache, always the block size.
* @return The block size.
*/
- int getSubBlockSize()
+ unsigned
+ getSubBlockSize() const
{
return blkSize;
}
{
return (tag);
}
+
+ /**
+ *iterated through all blocks and clear all locks
+ *Needed to clear all lock tracking at once
+ */
+ virtual void clearLocks();
};
-#endif
+#endif // __MEM_CACHE_TAGS_FA_LRU_HH__