return _slavePort->recvAtomic(pkt);
}
+Tick
+MasterPort::sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
+{
+ assert(pkt->isRequest());
+ return _slavePort->recvAtomicBackdoor(pkt, backdoor);
+}
+
void
MasterPort::sendFunctional(PacketPtr pkt)
{
* Slave port
*/
SlavePort::SlavePort(const std::string& name, MemObject* _owner, PortID id)
- : BaseSlavePort(name, id), _masterPort(NULL), owner(*_owner)
+ : BaseSlavePort(name, id), _masterPort(NULL), defaultBackdoorWarned(false),
+ owner(*_owner)
{
}
_connected = true;
}
+Tick
+SlavePort::recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
+{
+ if (!defaultBackdoorWarned) {
+ warn("Port %s doesn't support requesting a back door.", name());
+ defaultBackdoorWarned = true;
+ }
+ return recvAtomic(pkt);
+}
+
Tick
SlavePort::sendAtomicSnoop(PacketPtr pkt)
{
#define __MEM_PORT_HH__
#include "base/addr_range.hh"
+#include "mem/backdoor.hh"
#include "mem/packet.hh"
#include "sim/port.hh"
*/
Tick sendAtomic(PacketPtr pkt);
+ /**
+ * Send an atomic request packet like above, but also request a backdoor
+ * to the data being accessed.
+ *
+ * @param pkt Packet to send.
+ * @param backdoor Can be set to a back door pointer by the target to let
+ * caller have direct access to the requested data.
+ *
+ * @return Estimated latency of access.
+ */
+ Tick sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
+
/**
* Send a functional request packet, where the data is instantly
* updated everywhere in the memory system, without affecting the
private:
MasterPort* _masterPort;
+ bool defaultBackdoorWarned;
protected:
*/
virtual Tick recvAtomic(PacketPtr pkt) = 0;
+ /**
+ * Receive an atomic request packet from the master port, and optionally
+ * provide a backdoor to the data being accessed.
+ */
+ virtual Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
+
/**
* Receive a functional request packet from the master port.
*/