namespace
{
-class DefaultMasterPort : public MasterPort
+class DefaultRequestPort : public RequestPort
{
protected:
[[noreturn]] void
}
public:
- DefaultMasterPort() : MasterPort("default_master_port", nullptr) {}
+ DefaultRequestPort() : RequestPort("default_request_port", nullptr) {}
// Atomic protocol.
Tick recvAtomicSnoop(PacketPtr) override { blowUp(); }
void recvFunctionalSnoop(PacketPtr) override { blowUp(); }
};
-class DefaultSlavePort : public SlavePort
+class DefaultResponsePort : public ResponsePort
{
protected:
[[noreturn]] void
}
public:
- DefaultSlavePort() : SlavePort("default_slave_port", nullptr) {}
+ DefaultResponsePort() : ResponsePort("default_response_port", nullptr) {}
// Atomic protocol.
Tick recvAtomic(PacketPtr) override { blowUp(); }
AddrRangeList getAddrRanges() const override { return AddrRangeList(); }
};
-DefaultMasterPort defaultMasterPort;
-DefaultSlavePort defaultSlavePort;
+DefaultRequestPort defaultRequestPort;
+DefaultResponsePort defaultResponsePort;
} // anonymous namespace
/**
- * Master port
+ * Request port
*/
-MasterPort::MasterPort(const std::string& name, SimObject* _owner, PortID _id)
- : Port(name, _id), _slavePort(&defaultSlavePort), owner(*_owner)
+RequestPort::RequestPort(const std::string& name, SimObject* _owner,
+ PortID _id) : Port(name, _id), _responsePort(&defaultResponsePort),
+ owner(*_owner)
{
}
-MasterPort::~MasterPort()
+RequestPort::~RequestPort()
{
}
void
-MasterPort::bind(Port &peer)
+RequestPort::bind(Port &peer)
{
- auto *slave_port = dynamic_cast<SlavePort *>(&peer);
- fatal_if(!slave_port, "Can't bind port %s to non-slave port %s.",
+ auto *response_port = dynamic_cast<ResponsePort *>(&peer);
+ fatal_if(!response_port, "Can't bind port %s to non-response port %s.",
name(), peer.name());
- // master port keeps track of the slave port
- _slavePort = slave_port;
+ // request port keeps track of the response port
+ _responsePort = response_port;
Port::bind(peer);
- // slave port also keeps track of master port
- _slavePort->slaveBind(*this);
+ // response port also keeps track of request port
+ _responsePort->slaveBind(*this);
}
void
-MasterPort::unbind()
+RequestPort::unbind()
{
- panic_if(!isConnected(), "Can't unbind master port %s which is not bound.",
- name());
- _slavePort->slaveUnbind();
- _slavePort = &defaultSlavePort;
+ panic_if(!isConnected(), "Can't unbind request port %s which is "
+ "not bound.", name());
+ _responsePort->slaveUnbind();
+ _responsePort = &defaultResponsePort;
Port::unbind();
}
AddrRangeList
-MasterPort::getAddrRanges() const
+RequestPort::getAddrRanges() const
{
- return _slavePort->getAddrRanges();
+ return _responsePort->getAddrRanges();
}
void
-MasterPort::printAddr(Addr a)
+RequestPort::printAddr(Addr a)
{
auto req = std::make_shared<Request>(
a, 1, 0, Request::funcMasterId);
/**
* Slave port
*/
-SlavePort::SlavePort(const std::string& name, SimObject* _owner, PortID id)
- : Port(name, id), _masterPort(&defaultMasterPort),
+ResponsePort::ResponsePort(const std::string& name, SimObject* _owner,
+ PortID id) : Port(name, id), _requestPort(&defaultRequestPort),
defaultBackdoorWarned(false), owner(*_owner)
{
}
-SlavePort::~SlavePort()
+ResponsePort::~ResponsePort()
{
}
void
-SlavePort::slaveUnbind()
+ResponsePort::slaveUnbind()
{
- _masterPort = &defaultMasterPort;
+ _requestPort = &defaultRequestPort;
Port::unbind();
}
void
-SlavePort::slaveBind(MasterPort& master_port)
+ResponsePort::slaveBind(RequestPort& request_port)
{
- _masterPort = &master_port;
- Port::bind(master_port);
+ _requestPort = &request_port;
+ Port::bind(request_port);
}
Tick
-SlavePort::recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
+ResponsePort::recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
{
if (!defaultBackdoorWarned) {
warn("Port %s doesn't support requesting a back door.", name());
class SimObject;
/** Forward declaration */
+class MasterPort;
class SlavePort;
+class ResponsePort;
+
/**
- * A MasterPort is a specialisation of a BaseMasterPort, which
+ * A RequestPort is a specialisation of a Port, which
* implements the default protocol for the three different level of
* transport functions. In addition to the basic functionality of
* sending packets, it also has functions to receive range changes or
* The three protocols are atomic, timing, and functional, each with its own
* header file.
*/
-class MasterPort : public Port, public AtomicRequestProtocol,
+class RequestPort: public Port, public AtomicRequestProtocol,
public TimingRequestProtocol, public FunctionalRequestProtocol
{
- friend class SlavePort;
+ friend class ResponsePort;
private:
- SlavePort *_slavePort;
+ ResponsePort *_responsePort;
protected:
SimObject &owner;
public:
- MasterPort(const std::string& name, SimObject* _owner,
+ RequestPort(const std::string& name, SimObject* _owner,
PortID id=InvalidPortID);
- virtual ~MasterPort();
+ virtual ~RequestPort();
/**
- * Bind this master port to a slave port. This also does the
- * mirror action and binds the slave port to the master port.
+ * Bind this request port to a response port. This also does the
+ * mirror action and binds the response port to the request port.
*/
void bind(Port &peer) override;
/**
- * Unbind this master port and the associated slave port.
+ * Unbind this request port and the associated response port.
*/
void unbind() override;
/**
- * Determine if this master port is snooping or not. The default
+ * Determine if this request port is snooping or not. The default
* implementation returns false and thus tells the neighbour we
- * are not snooping. Any master port that wants to receive snoop
+ * are not snooping. Any request port that wants to receive snoop
* requests (e.g. a cache connected to a bus) has to override this
* function.
*
virtual bool isSnooping() const { return false; }
/**
- * Get the address ranges of the connected slave port.
+ * Get the address ranges of the connected responder port.
*/
AddrRangeList getAddrRanges() const;
/* The timing protocol. */
/**
- * Attempt to send a timing request to the slave port by calling
+ * Attempt to send a timing request to the responder port by calling
* its corresponding receive function. If the send does not
* succeed, as indicated by the return value, then the sender must
* wait for a recvReqRetry at which point it can re-issue a
bool sendTimingReq(PacketPtr pkt);
/**
- * Check if the slave can handle a timing request.
+ * Check if the responder can handle a timing request.
*
* If the send cannot be handled at the moment, as indicated by
* the return value, then the sender will receive a recvReqRetry
*
* @param pkt Packet to send.
*
- * @return If the send was succesful or not.
+ * @return If the send was successful or not.
*/
bool tryTiming(PacketPtr pkt) const;
/**
- * Attempt to send a timing snoop response packet to the slave
+ * Attempt to send a timing snoop response packet to the response
* port by calling its corresponding receive function. If the send
* does not succeed, as indicated by the return value, then the
* sender must wait for a recvRetrySnoop at which point it can
bool sendTimingSnoopResp(PacketPtr pkt);
/**
- * Send a retry to the slave port that previously attempted a
- * sendTimingResp to this master port and failed. Note that this
+ * Send a retry to the response port that previously attempted a
+ * sendTimingResp to this request port and failed. Note that this
* is virtual so that the "fake" snoop response port in the
* coherent crossbar can override the behaviour.
*/
protected:
/**
- * Called to receive an address range change from the peer slave
+ * Called to receive an address range change from the peer response
* port. The default implementation ignores the change and does
* nothing. Override this function in a derived class if the owner
* needs to be aware of the address ranges, e.g. in an
}
};
+class M5_DEPRECATED MasterPort : public RequestPort
+{
+ public:
+ MasterPort(const std::string& name, SimObject* _owner,
+ PortID id=InvalidPortID) : RequestPort(name, _owner, id)
+ {}
+};
+
/**
- * A SlavePort is a specialisation of a port. In addition to the
- * basic functionality of sending packets to its master peer, it also
- * has functions specific to a slave, e.g. to send range changes
+ * A ResponsePort is a specialization of a port. In addition to the
+ * basic functionality of sending packets to its requestor peer, it also
+ * has functions specific to a responder, e.g. to send range changes
* and get the address ranges that the port responds to.
*
* The three protocols are atomic, timing, and functional, each with its own
* header file.
*/
-class SlavePort : public Port, public AtomicResponseProtocol,
+class ResponsePort : public Port, public AtomicResponseProtocol,
public TimingResponseProtocol, public FunctionalResponseProtocol
{
- friend class MasterPort;
+ friend class RequestPort;
private:
- MasterPort* _masterPort;
+ RequestPort* _requestPort;
bool defaultBackdoorWarned;
SimObject& owner;
public:
- SlavePort(const std::string& name, SimObject* _owner,
+ ResponsePort(const std::string& name, SimObject* _owner,
PortID id=InvalidPortID);
- virtual ~SlavePort();
+ virtual ~ResponsePort();
/**
- * Find out if the peer master port is snooping or not.
+ * Find out if the peer request port is snooping or not.
*
- * @return true if the peer master port is snooping
+ * @return true if the peer request port is snooping
*/
- bool isSnooping() const { return _masterPort->isSnooping(); }
+ bool isSnooping() const { return _requestPort->isSnooping(); }
/**
* Called by the owner to send a range change
*/
- void sendRangeChange() const { _masterPort->recvRangeChange(); }
+ void sendRangeChange() const { _requestPort->recvRangeChange(); }
/**
* Get a list of the non-overlapping address ranges the owner is
- * responsible for. All slave ports must override this function
+ * responsible for. All response ports must override this function
* and return a populated list with at least one item.
*
* @return a list of ranges responded to
virtual AddrRangeList getAddrRanges() const = 0;
/**
- * We let the master port do the work, so these don't do anything.
+ * We let the request port do the work, so these don't do anything.
*/
void unbind() override {}
void bind(Port &peer) override {}
sendAtomicSnoop(PacketPtr pkt)
{
try {
- return AtomicResponseProtocol::sendSnoop(_masterPort, pkt);
+ return AtomicResponseProtocol::sendSnoop(_requestPort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
sendFunctionalSnoop(PacketPtr pkt) const
{
try {
- FunctionalResponseProtocol::sendSnoop(_masterPort, pkt);
+ FunctionalResponseProtocol::sendSnoop(_requestPort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
/* The timing protocol. */
/**
- * Attempt to send a timing response to the master port by calling
+ * Attempt to send a timing response to the request port by calling
* its corresponding receive function. If the send does not
* succeed, as indicated by the return value, then the sender must
* wait for a recvRespRetry at which point it can re-issue a
*
* @param pkt Packet to send.
*
- * @return If the send was succesful or not.
+ * @return If the send was successful or not.
*/
bool
sendTimingResp(PacketPtr pkt)
{
try {
- return TimingResponseProtocol::sendResp(_masterPort, pkt);
+ return TimingResponseProtocol::sendResp(_requestPort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
/**
- * Attempt to send a timing snoop request packet to the master port
+ * Attempt to send a timing snoop request packet to the request port
* by calling its corresponding receive function. Snoop requests
* always succeed and hence no return value is needed.
*
sendTimingSnoopReq(PacketPtr pkt)
{
try {
- TimingResponseProtocol::sendSnoopReq(_masterPort, pkt);
+ TimingResponseProtocol::sendSnoopReq(_requestPort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
/**
- * Send a retry to the master port that previously attempted a
- * sendTimingReq to this slave port and failed.
+ * Send a retry to the request port that previously attempted a
+ * sendTimingReq to this response port and failed.
*/
void
sendRetryReq()
{
try {
- TimingResponseProtocol::sendRetryReq(_masterPort);
+ TimingResponseProtocol::sendRetryReq(_requestPort);
} catch (UnboundPortException) {
reportUnbound();
}
}
/**
- * Send a retry to the master port that previously attempted a
- * sendTimingSnoopResp to this slave port and failed.
+ * Send a retry to the request port that previously attempted a
+ * sendTimingSnoopResp to this response port and failed.
*/
void
sendRetrySnoopResp()
{
try {
- TimingResponseProtocol::sendRetrySnoopResp(_masterPort);
+ TimingResponseProtocol::sendRetrySnoopResp(_requestPort);
} catch (UnboundPortException) {
reportUnbound();
}
protected:
/**
- * Called by the master port to unbind. Should never be called
+ * Called by the request port to unbind. Should never be called
* directly.
*/
void slaveUnbind();
/**
- * Called by the master port to bind. Should never be called
+ * Called by the request port to bind. Should never be called
* directly.
*/
- void slaveBind(MasterPort& master_port);
+ void slaveBind(RequestPort& request_port);
/**
* Default implementations.
}
};
+class M5_DEPRECATED SlavePort : public ResponsePort
+{
+ public:
+ SlavePort(const std::string& name, SimObject* _owner,
+ PortID id=InvalidPortID) : ResponsePort(name, _owner, id)
+ {}
+};
+
inline Tick
-MasterPort::sendAtomic(PacketPtr pkt)
+RequestPort::sendAtomic(PacketPtr pkt)
{
try {
- return AtomicRequestProtocol::send(_slavePort, pkt);
+ return AtomicRequestProtocol::send(_responsePort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline Tick
-MasterPort::sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
+RequestPort::sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
{
try {
- return AtomicRequestProtocol::sendBackdoor(_slavePort, pkt, backdoor);
+ return AtomicRequestProtocol::sendBackdoor(_responsePort,
+ pkt, backdoor);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline void
-MasterPort::sendFunctional(PacketPtr pkt) const
+RequestPort::sendFunctional(PacketPtr pkt) const
{
try {
- return FunctionalRequestProtocol::send(_slavePort, pkt);
+ return FunctionalRequestProtocol::send(_responsePort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline bool
-MasterPort::sendTimingReq(PacketPtr pkt)
+RequestPort::sendTimingReq(PacketPtr pkt)
{
try {
- return TimingRequestProtocol::sendReq(_slavePort, pkt);
+ return TimingRequestProtocol::sendReq(_responsePort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline bool
-MasterPort::tryTiming(PacketPtr pkt) const
+RequestPort::tryTiming(PacketPtr pkt) const
{
try {
- return TimingRequestProtocol::trySend(_slavePort, pkt);
+ return TimingRequestProtocol::trySend(_responsePort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline bool
-MasterPort::sendTimingSnoopResp(PacketPtr pkt)
+RequestPort::sendTimingSnoopResp(PacketPtr pkt)
{
try {
- return TimingRequestProtocol::sendSnoopResp(_slavePort, pkt);
+ return TimingRequestProtocol::sendSnoopResp(_responsePort, pkt);
} catch (UnboundPortException) {
reportUnbound();
}
}
inline void
-MasterPort::sendRetryResp()
+RequestPort::sendRetryResp()
{
try {
- TimingRequestProtocol::sendRetryResp(_slavePort);
+ TimingRequestProtocol::sendRetryResp(_responsePort);
} catch (UnboundPortException) {
reportUnbound();
}