#define __MEM_PORT_HH__
#include "base/addr_range.hh"
+#include "mem/backdoor.hh"
#include "mem/packet.hh"
#include "sim/port.hh"
public:
- virtual void bind(BaseSlavePort& slave_port) = 0;
- virtual void unbind() = 0;
BaseSlavePort& getSlavePort() const;
- bool isConnected() const;
};
public:
BaseMasterPort& getMasterPort() const;
- bool isConnected() const;
};
* Bind this master port to a slave port. This also does the
* mirror action and binds the slave port to the master port.
*/
- void bind(BaseSlavePort& slave_port);
+ void bind(Port &peer) override;
/**
* Unbind this master port and the associated slave port.
*/
- void unbind();
+ void unbind() override;
/**
* Send an atomic request packet, where the data is moved and the
*/
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 AddrRangeList getAddrRanges() const = 0;
+ /**
+ * We let the master port do the work, so these don't do anything.
+ */
+ void unbind() override {}
+ void bind(Port &peer) override {}
+
protected:
/**
* Called by the master port to unbind. Should never be called
* directly.
*/
- void unbind();
+ void slaveUnbind();
/**
* Called by the master port to bind. Should never be called
* directly.
*/
- void bind(MasterPort& master_port);
+ void slaveBind(MasterPort& master_port);
/**
* Receive an atomic request packet from the master port.
*/
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.
*/