gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
ResponsePort Class Referenceabstract

A ResponsePort is a specialization of a port. More...

#include <port.hh>

Inheritance diagram for ResponsePort:
Port AtomicResponseProtocol TimingResponseProtocol FunctionalResponseProtocol AddrMapper::MapperResponsePort Bridge::BridgeResponsePort CommMonitor::MonitorResponsePort DRAMSim2::MemoryPort DRAMsim3::MemoryPort LdsState::CuSidePort MemCheckerMonitor::MonitorResponsePort QueuedResponsePort sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort SerialLink::SerialLinkResponsePort SimpleCache::CPUSidePort SimpleMemobj::CPUSidePort SimpleMemory::MemoryPort SlavePort TLBCoalescer::CpuSidePort TokenResponsePort X86ISA::GpuTLB::CpuSidePort

Public Member Functions

 ResponsePort (const std::string &name, SimObject *_owner, PortID id=InvalidPortID)
 Response port. More...
 
virtual ~ResponsePort ()
 
bool isSnooping () const
 Find out if the peer request port is snooping or not. More...
 
void sendRangeChange () const
 Called by the owner to send a range change. More...
 
virtual AddrRangeList getAddrRanges () const =0
 Get a list of the non-overlapping address ranges the owner is responsible for. More...
 
void unbind () override
 We let the request port do the work, so these don't do anything. More...
 
void bind (Port &peer) override
 Attach to a peer port. More...
 
Tick sendAtomicSnoop (PacketPtr pkt)
 Send an atomic snoop request packet, where the data is moved and the state is updated in zero time, without interleaving with other memory accesses. More...
 
void sendFunctionalSnoop (PacketPtr pkt) const
 Send a functional snoop request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block. More...
 
bool sendTimingResp (PacketPtr pkt)
 Attempt to send a timing response to the request port by calling its corresponding receive function. More...
 
void sendTimingSnoopReq (PacketPtr pkt)
 Attempt to send a timing snoop request packet to the request port by calling its corresponding receive function. More...
 
void sendRetryReq ()
 Send a retry to the request port that previously attempted a sendTimingReq to this response port and failed. More...
 
void sendRetrySnoopResp ()
 Send a retry to the request port that previously attempted a sendTimingSnoopResp to this response port and failed. More...
 
- Public Member Functions inherited from Port
virtual ~Port ()
 Virtual destructor due to inheritance. More...
 
PortgetPeer ()
 Return a reference to this port's peer. More...
 
const std::string name () const
 Return port name (for DPRINTF). More...
 
PortID getId () const
 Get the port id. More...
 
bool isConnected () const
 Is this port currently connected to a peer? More...
 
void takeOverFrom (Port *old)
 A utility function to make it easier to swap out ports. More...
 

Protected Member Functions

void responderUnbind ()
 Called by the request port to unbind. More...
 
void responderBind (RequestPort &request_port)
 Called by the request port to bind. More...
 
Tick recvAtomicBackdoor (PacketPtr pkt, MemBackdoorPtr &backdoor) override
 Default implementations. More...
 
bool tryTiming (PacketPtr pkt) override
 Availability request from the peer. More...
 
bool recvTimingSnoopResp (PacketPtr pkt) override
 Receive a timing snoop response from the peer. More...
 
- Protected Member Functions inherited from Port
void reportUnbound () const
 
 Port (const std::string &_name, PortID _id)
 Abstract base class for ports. More...
 
- Protected Member Functions inherited from AtomicResponseProtocol
Tick sendSnoop (AtomicRequestProtocol *peer, PacketPtr pkt)
 Send an atomic snoop request packet, where the data is moved and the state is updated in zero time, without interleaving with other memory accesses. More...
 
virtual Tick recvAtomic (PacketPtr pkt)=0
 Receive an atomic request packet from the peer. More...
 
- Protected Member Functions inherited from TimingResponseProtocol
bool sendResp (TimingRequestProtocol *peer, PacketPtr pkt)
 Attempt to send a timing response to the peer by calling its corresponding receive function. More...
 
void sendSnoopReq (TimingRequestProtocol *peer, PacketPtr pkt)
 Attempt to send a timing snoop request packet to the peer by calling its corresponding receive function. More...
 
void sendRetryReq (TimingRequestProtocol *peer)
 Send a retry to the peer that previously attempted a sendTimingReq to this protocol and failed. More...
 
void sendRetrySnoopResp (TimingRequestProtocol *peer)
 Send a retry to the peer that previously attempted a sendTimingSnoopResp to this peer and failed. More...
 
virtual bool recvTimingReq (PacketPtr pkt)=0
 Receive a timing request from the peer. More...
 
virtual void recvRespRetry ()=0
 Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called on the peer) and was unsuccessful. More...
 
- Protected Member Functions inherited from FunctionalResponseProtocol
void sendSnoop (FunctionalRequestProtocol *peer, PacketPtr pkt) const
 Send a functional snoop request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block. More...
 
virtual void recvFunctional (PacketPtr pkt)=0
 Receive a functional request packet from the peer. More...
 

Protected Attributes

SimObjectowner
 
- Protected Attributes inherited from Port
const PortID id
 A numeric identifier to distinguish ports in a vector, and set to InvalidPortID in case this port is not part of a vector. More...
 
Port_peer
 A pointer to this port's peer. More...
 
bool _connected
 Whether this port is currently connected to a peer port. More...
 

Private Attributes

RequestPort_requestPort
 
bool defaultBackdoorWarned
 

Friends

class RequestPort
 

Detailed Description

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.

Definition at line 265 of file port.hh.

Constructor & Destructor Documentation

◆ ResponsePort()

ResponsePort::ResponsePort ( const std::string &  name,
SimObject _owner,
PortID  id = InvalidPortID 
)

Response port.

Definition at line 169 of file port.cc.

◆ ~ResponsePort()

ResponsePort::~ResponsePort ( )
virtual

Definition at line 175 of file port.cc.

Member Function Documentation

◆ bind()

void ResponsePort::bind ( Port peer)
inlineoverridevirtual

Attach to a peer port.

Reimplemented from Port.

Reimplemented in TokenResponsePort.

Definition at line 308 of file port.hh.

◆ getAddrRanges()

virtual AddrRangeList ResponsePort::getAddrRanges ( ) const
pure virtual

◆ isSnooping()

bool ResponsePort::isSnooping ( ) const
inline

◆ recvAtomicBackdoor()

Tick ResponsePort::recvAtomicBackdoor ( PacketPtr  pkt,
MemBackdoorPtr backdoor 
)
overrideprotectedvirtual

◆ recvTimingSnoopResp()

bool ResponsePort::recvTimingSnoopResp ( PacketPtr  pkt)
inlineoverrideprotectedvirtual

Receive a timing snoop response from the peer.

Implements TimingResponseProtocol.

Reimplemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort.

Definition at line 446 of file port.hh.

References Port::name(), and panic.

◆ responderBind()

void ResponsePort::responderBind ( RequestPort request_port)
protected

Called by the request port to bind.

Should never be called directly.

Definition at line 187 of file port.cc.

References _requestPort, and Port::bind().

Referenced by RequestPort::bind().

◆ responderUnbind()

void ResponsePort::responderUnbind ( )
protected

Called by the request port to unbind.

Should never be called directly.

Definition at line 180 of file port.cc.

References _requestPort, and Port::unbind().

Referenced by RequestPort::unbind(), and TokenResponsePort::unbind().

◆ sendAtomicSnoop()

Tick ResponsePort::sendAtomicSnoop ( PacketPtr  pkt)
inline

Send an atomic snoop request packet, where the data is moved and the state is updated in zero time, without interleaving with other memory accesses.

Parameters
pktSnoop packet to send.
Returns
Estimated latency of access.

Definition at line 323 of file port.hh.

References _requestPort, Port::reportUnbound(), and AtomicResponseProtocol::sendSnoop().

Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), AddrMapper::recvAtomicSnoop(), and CommMonitor::recvAtomicSnoop().

◆ sendFunctionalSnoop()

void ResponsePort::sendFunctionalSnoop ( PacketPtr  pkt) const
inline

Send a functional snoop request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block.

Parameters
pktSnoop packet to send.

Definition at line 343 of file port.hh.

References _requestPort, Port::reportUnbound(), and FunctionalResponseProtocol::sendSnoop().

Referenced by BaseCache::functionalAccess(), MemCheckerMonitor::recvFunctionalSnoop(), AddrMapper::recvFunctionalSnoop(), and CommMonitor::recvFunctionalSnoop().

◆ sendRangeChange()

void ResponsePort::sendRangeChange ( ) const
inline

◆ sendRetryReq()

void ResponsePort::sendRetryReq ( )
inline

◆ sendRetrySnoopResp()

void ResponsePort::sendRetrySnoopResp ( )
inline

Send a retry to the request port that previously attempted a sendTimingSnoopResp to this response port and failed.

Definition at line 412 of file port.hh.

References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendRetrySnoopResp().

Referenced by CommMonitor::recvRetrySnoopResp(), BaseXBar::SnoopRespLayer::sendRetry(), and CoherentXBar::SnoopRespPort::sendRetryResp().

◆ sendTimingResp()

bool ResponsePort::sendTimingResp ( PacketPtr  pkt)
inline

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 sendTimingResp.

Parameters
pktPacket to send.
Returns
If the send was successful or not.

Definition at line 367 of file port.hh.

References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendResp().

Referenced by PendingWriteInst::ackWriteCompletion(), SimpleMemory::dequeue(), LdsState::process(), StubSlavePort::processResponseEvent(), TokenResponsePort::recvRespRetry(), MemCheckerMonitor::recvTimingResp(), AddrMapper::recvTimingResp(), CommMonitor::recvTimingResp(), SimpleMemobj::CPUSidePort::sendPacket(), SimpleCache::CPUSidePort::sendPacket(), DRAMSim2::sendResponse(), DRAMsim3::sendResponse(), RespPacketQueue::sendTiming(), TokenResponsePort::sendTimingResp(), and TLBCoalescer::updatePhysAddresses().

◆ sendTimingSnoopReq()

void ResponsePort::sendTimingSnoopReq ( PacketPtr  pkt)
inline

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.

Parameters
pktPacket to send.

Definition at line 384 of file port.hh.

References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendSnoopReq().

Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvTimingSnoopReq(), AddrMapper::recvTimingSnoopReq(), CommMonitor::recvTimingSnoopReq(), and Cache::sendMSHRQueuePacket().

◆ tryTiming()

bool ResponsePort::tryTiming ( PacketPtr  pkt)
inlineoverrideprotectedvirtual

Availability request from the peer.

Implements TimingResponseProtocol.

Reimplemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort.

Definition at line 440 of file port.hh.

References Port::name(), and panic.

◆ unbind()

void ResponsePort::unbind ( )
inlineoverridevirtual

We let the request port do the work, so these don't do anything.

Reimplemented from Port.

Reimplemented in TokenResponsePort.

Definition at line 307 of file port.hh.

Friends And Related Function Documentation

◆ RequestPort

friend class RequestPort
friend

Definition at line 268 of file port.hh.

Member Data Documentation

◆ _requestPort

RequestPort* ResponsePort::_requestPort
private

◆ defaultBackdoorWarned

bool ResponsePort::defaultBackdoorWarned
private

Definition at line 273 of file port.hh.

Referenced by recvAtomicBackdoor().

◆ owner

SimObject& ResponsePort::owner
protected

Definition at line 276 of file port.hh.

Referenced by BaseCache::CacheResponsePort::setBlocked().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:30 for gem5 by doxygen 1.8.17