58a59
> #include "mem/cache/tags/base.hh"
69d69
< template <class TagStore>
73,76d72
< /** Define the type of cache block to use. */
< typedef typename TagStore::BlkType BlkType;
< /** A typedef for a list of BlkType pointers. */
< typedef typename TagStore::BlkList BlkList;
77a74,76
> /** A typedef for a list of CacheBlk pointers. */
> typedef std::list<CacheBlk*> BlkList;
>
79d77
< typedef CacheBlkVisitorWrapper<Cache<TagStore>, BlkType> WrappedBlkVisitor;
90c88
< Cache<TagStore> *cache;
---
> Cache *cache;
106c104
< CpuSidePort(const std::string &_name, Cache<TagStore> *_cache,
---
> CpuSidePort(const std::string &_name, Cache *_cache,
122c120
< Cache<TagStore> &cache;
---
> Cache &cache;
127c125
< CacheReqPacketQueue(Cache<TagStore> &cache, MasterPort &port,
---
> CacheReqPacketQueue(Cache &cache, MasterPort &port,
156c154
< Cache<TagStore> *cache;
---
> Cache *cache;
170c168
< MemSidePort(const std::string &_name, Cache<TagStore> *_cache,
---
> MemSidePort(const std::string &_name, Cache *_cache,
175c173
< TagStore *tags;
---
> BaseTags *tags;
181c179
< BlkType *tempBlock;
---
> CacheBlk *tempBlock;
213c211
< bool access(PacketPtr pkt, BlkType *&blk,
---
> bool access(PacketPtr pkt, CacheBlk *&blk,
219c217
< void cmpAndSwap(BlkType *blk, PacketPtr pkt);
---
> void cmpAndSwap(CacheBlk *blk, PacketPtr pkt);
228c226
< BlkType *allocateBlock(Addr addr, bool is_secure, PacketList &writebacks);
---
> CacheBlk *allocateBlock(Addr addr, bool is_secure, PacketList &writebacks);
239c237
< BlkType *handleFill(PacketPtr pkt, BlkType *blk,
---
> CacheBlk *handleFill(PacketPtr pkt, CacheBlk *blk,
290c288
< void satisfyCpuSideRequest(PacketPtr pkt, BlkType *blk,
---
> void satisfyCpuSideRequest(PacketPtr pkt, CacheBlk *blk,
293c291
< bool satisfyMSHR(MSHR *mshr, PacketPtr pkt, BlkType *blk);
---
> bool satisfyMSHR(MSHR *mshr, PacketPtr pkt, CacheBlk *blk);
303c301
< void handleSnoop(PacketPtr ptk, BlkType *blk,
---
> void handleSnoop(PacketPtr ptk, CacheBlk *blk,
311c309
< PacketPtr writebackBlk(BlkType *blk);
---
> PacketPtr writebackBlk(CacheBlk *blk);
324c322
< bool writebackVisitor(BlkType &blk);
---
> bool writebackVisitor(CacheBlk &blk);
332c330
< bool invalidateVisitor(BlkType &blk);
---
> bool invalidateVisitor(CacheBlk &blk);
352c350
< PacketPtr getBusPacket(PacketPtr cpu_pkt, BlkType *blk,
---
> PacketPtr getBusPacket(PacketPtr cpu_pkt, CacheBlk *blk,
419a418,475
> /**
> * Wrap a method and present it as a cache block visitor.
> *
> * For example the forEachBlk method in the tag arrays expects a
> * callable object/function as their parameter. This class wraps a
> * method in an object and presents callable object that adheres to
> * the cache block visitor protocol.
> */
> class CacheBlkVisitorWrapper : public CacheBlkVisitor
> {
> public:
> typedef bool (Cache::*VisitorPtr)(CacheBlk &blk);
>
> CacheBlkVisitorWrapper(Cache &_cache, VisitorPtr _visitor)
> : cache(_cache), visitor(_visitor) {}
>
> bool operator()(CacheBlk &blk) M5_ATTR_OVERRIDE {
> return (cache.*visitor)(blk);
> }
>
> private:
> Cache &cache;
> VisitorPtr visitor;
> };
>
> /**
> * Cache block visitor that determines if there are dirty blocks in a
> * cache.
> *
> * Use with the forEachBlk method in the tag array to determine if the
> * array contains dirty blocks.
> */
> class CacheBlkIsDirtyVisitor : public CacheBlkVisitor
> {
> public:
> CacheBlkIsDirtyVisitor()
> : _isDirty(false) {}
>
> bool operator()(CacheBlk &blk) M5_ATTR_OVERRIDE {
> if (blk.isDirty()) {
> _isDirty = true;
> return false;
> } else {
> return true;
> }
> }
>
> /**
> * Does the array contain a dirty line?
> *
> * \return true if yes, false otherwise.
> */
> bool isDirty() const { return _isDirty; };
>
> private:
> bool _isDirty;
> };
>