}
/** Pointer to the System object.
- * This is used for getting the number of masters in the system which is
+ * This is used for getting the number of requestors in the system which is
* needed when registering stats
*/
System *_system;
typedef AbstractMemoryParams Params;
- AbstractMemory(const Params* p);
+ AbstractMemory(const Params &p);
virtual ~AbstractMemory() {}
+ void initState() override;
+
/**
* See if this is a null memory that should never store data and
* always return zero.
*
* @return true if null
*/
- bool isNull() const { return params()->null; }
+ bool isNull() const { return params().null; }
/**
* Set the host memory backing store to be used by this memory
*/
void setBackingStore(uint8_t* pmem_addr);
+ void
+ getBackdoor(MemBackdoorPtr &bd_ptr)
+ {
+ if (lockedAddrList.empty() && backdoor.ptr())
+ bd_ptr = &backdoor;
+ }
+
/**
* Get the list of locked addresses to allow checkpointing.
*/
- const std::list<LockedAddr>& getLockedAddrList() const
- { return lockedAddrList; }
+ const std::list<LockedAddr> &
+ getLockedAddrList() const
+ {
+ return lockedAddrList;
+ }
/**
* Add a locked address to allow for checkpointing.
*/
- void addLockedAddr(LockedAddr addr) { lockedAddrList.push_back(addr); }
+ void
+ addLockedAddr(LockedAddr addr)
+ {
+ backdoor.invalidate();
+ lockedAddrList.push_back(addr);
+ }
/** read the system pointer
* Implemented for completeness with the setter
*/
void system(System *sys) { _system = sys; }
- const Params *
+ const Params &
params() const
{
- return dynamic_cast<const Params *>(_params);
+ return dynamic_cast<const Params &>(_params);
}
/**