*
* @return string with basic state information
*/
- virtual std::string print() const
+ std::string
+ print() const override
{
/**
* state M O E S I
default: s = 'T'; break; // @TODO add other types
}
return csprintf("state: %x (%c) valid: %d writable: %d readable: %d "
- "dirty: %d | tag: %#x set: %#x way: %#x", status, s,
+ "dirty: %d | tag: %#x %s", status, s,
isValid(), isWritable(), isReadable(), isDirty(), tag,
- getSet(), getWay());
+ ReplaceableEntry::print());
}
/**
#include <cstdint>
#include <memory>
+#include "base/cprintf.hh"
+
/**
* The replacement data needed by replacement policies. Each replacement policy
* should have its own implementation of replacement data.
* @return The way to which this entry belongs.
*/
uint32_t getWay() const { return _way; }
+
+ /**
+ * Prints relevant information about this entry.
+ *
+ * @return A string containg the contents of this entry.
+ */
+ virtual std::string
+ print() const
+ {
+ return csprintf("set: %#x way: %#x", getSet(), getWay());
+ }
};
#endif // __MEM_CACHE_REPLACEMENT_POLICIES_REPLACEABLE_ENTRY_HH_