gem5  v21.1.0.2
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
gem5::ResponsePort Class Referenceabstract

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

#include <port.hh>

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

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 gem5::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 gem5::Port
void reportUnbound () const
 
 Port (const std::string &_name, PortID _id)
 Abstract base class for ports. More...
 
- Protected Member Functions inherited from gem5::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 gem5::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 gem5::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 gem5::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 268 of file port.hh.

Constructor & Destructor Documentation

◆ ResponsePort()

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

Response port.

Definition at line 172 of file port.cc.

◆ ~ResponsePort()

gem5::ResponsePort::~ResponsePort ( )
virtual

Definition at line 178 of file port.cc.

Member Function Documentation

◆ bind()

void gem5::ResponsePort::bind ( Port peer)
inlineoverridevirtual

Attach to a peer port.

Reimplemented from gem5::Port.

Reimplemented in gem5::TokenResponsePort.

Definition at line 311 of file port.hh.

◆ getAddrRanges()

virtual AddrRangeList gem5::ResponsePort::getAddrRanges ( ) const
pure virtual

◆ isSnooping()

bool gem5::ResponsePort::isSnooping ( ) const
inline

◆ recvAtomicBackdoor()

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

◆ recvTimingSnoopResp()

bool gem5::ResponsePort::recvTimingSnoopResp ( PacketPtr  pkt)
inlineoverrideprotectedvirtual

Receive a timing snoop response from the peer.

Implements gem5::TimingResponseProtocol.

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

Definition at line 449 of file port.hh.

References gem5::Port::name(), and panic.

◆ responderBind()

void gem5::ResponsePort::responderBind ( RequestPort request_port)
protected

Called by the request port to bind.

Should never be called directly.

Definition at line 190 of file port.cc.

References _requestPort, and gem5::Port::bind().

Referenced by gem5::RequestPort::bind().

◆ responderUnbind()

void gem5::ResponsePort::responderUnbind ( )
protected

Called by the request port to unbind.

Should never be called directly.

Definition at line 183 of file port.cc.

References _requestPort, and gem5::Port::unbind().

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

◆ sendAtomicSnoop()

Tick gem5::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 326 of file port.hh.

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

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

◆ sendFunctionalSnoop()

void gem5::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 346 of file port.hh.

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

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

◆ sendRangeChange()

void gem5::ResponsePort::sendRangeChange ( ) const
inline

◆ sendRetryReq()

void gem5::ResponsePort::sendRetryReq ( )
inline

◆ sendRetrySnoopResp()

void gem5::ResponsePort::sendRetrySnoopResp ( )
inline

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

Definition at line 415 of file port.hh.

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

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

◆ sendTimingResp()

bool gem5::ResponsePort::sendTimingResp ( PacketPtr  pkt)
inline

◆ sendTimingSnoopReq()

void gem5::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 387 of file port.hh.

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

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

◆ tryTiming()

bool gem5::ResponsePort::tryTiming ( PacketPtr  pkt)
inlineoverrideprotectedvirtual

Availability request from the peer.

Implements gem5::TimingResponseProtocol.

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

Definition at line 443 of file port.hh.

References gem5::Port::name(), and panic.

◆ unbind()

void gem5::ResponsePort::unbind ( )
inlineoverridevirtual

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

Reimplemented from gem5::Port.

Reimplemented in gem5::TokenResponsePort.

Definition at line 310 of file port.hh.

Friends And Related Function Documentation

◆ RequestPort

friend class RequestPort
friend

Definition at line 271 of file port.hh.

Member Data Documentation

◆ _requestPort

RequestPort* gem5::ResponsePort::_requestPort
private

◆ defaultBackdoorWarned

bool gem5::ResponsePort::defaultBackdoorWarned
private

Definition at line 276 of file port.hh.

Referenced by recvAtomicBackdoor().

◆ owner

SimObject& gem5::ResponsePort::owner
protected

Definition at line 279 of file port.hh.

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


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

Generated on Tue Sep 21 2021 12:28:04 for gem5 by doxygen 1.8.17