+ /**
+ * Find next request ready time from among possible sources.
+ */
+ Tick nextMSHRReadyTime() const;
+
+ public:
+ /** Instantiates a basic cache object. */
+ Cache(const Params *p);
+
+ /** Non-default destructor is needed to deallocate memory. */
+ virtual ~Cache();
+
+ void regStats();
+
+ /** serialize the state of the caches
+ * We currently don't support checkpointing cache state, so this panics.
+ */
+ virtual void serialize(std::ostream &os);
+ void unserialize(Checkpoint *cp, const std::string §ion);
+};
+
+/**
+ * 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);