gem5  v22.1.0.0
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::ExternalSlave::ExternalPort gem5::LdsState::CuSidePort gem5::MemCheckerMonitor::MonitorResponsePort gem5::OutgoingRequestBridge::OutgoingRequestPort gem5::PortTerminator::RespPort gem5::QueuedResponsePort gem5::SerialLink::SerialLinkResponsePort gem5::SimpleCache::CPUSidePort gem5::SimpleMemobj::CPUSidePort gem5::SlavePort gem5::SysBridge::SysBridgeSourcePort gem5::TLBCoalescer::CpuSidePort gem5::ThreadBridge::IncomingPort gem5::TokenResponsePort gem5::VegaISA::GpuTLB::CpuSidePort gem5::VegaTLBCoalescer::CpuSidePort gem5::X86ISA::GpuTLB::CpuSidePort gem5::memory::CfiMemory::MemoryPort gem5::memory::DRAMSim2::MemoryPort gem5::memory::DRAMsim3::MemoryPort gem5::memory::SimpleMemory::MemoryPort 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 173 of file port.cc.

◆ ~ResponsePort()

gem5::ResponsePort::~ResponsePort ( )
virtual

Definition at line 179 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

Get a list of the non-overlapping address ranges the owner is responsible for.

All response ports must override this function and return a populated list with at least one item.

Returns
a list of ranges responded to

Implemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort, gem5::ThreadBridge::IncomingPort, gem5::SysBridge::SysBridgeSourcePort, gem5::memory::SimpleMemory::MemoryPort, gem5::NoncoherentXBar::NoncoherentXBarResponsePort, gem5::MemDelay::ResponsePort, gem5::memory::MemCtrl::MemoryPort, gem5::CoherentXBar::CoherentXBarResponsePort, gem5::memory::CfiMemory::MemoryPort, gem5::BaseCache::CpuSidePort, gem5::AddrMapper::MapperResponsePort, gem5::SimpleMemobj::CPUSidePort, gem5::SimpleCache::CPUSidePort, gem5::PioPort< Device >, gem5::PioPort< gem5::PioDevice >, gem5::PioPort< gem5::X86ISA::Interrupts >, gem5::OutgoingRequestBridge::OutgoingRequestPort, gem5::SerialLink::SerialLinkResponsePort, gem5::ruby::RubyPort::PioResponsePort, gem5::ruby::RubyPort::MemResponsePort, gem5::ruby::GPUCoalescer::GMTokenPort, gem5::memory::qos::MemSinkCtrl::MemoryPort, gem5::MemCheckerMonitor::MonitorResponsePort, gem5::ExternalSlave::ExternalPort, gem5::memory::DRAMsim3::MemoryPort, gem5::memory::DRAMSim2::MemoryPort, gem5::CommMonitor::MonitorResponsePort, gem5::Bridge::BridgeResponsePort, gem5::LdsState::CuSidePort, gem5::X86ISA::IntResponsePort< Device >, gem5::X86ISA::IntResponsePort< gem5::X86ISA::Interrupts >, gem5::SMMUATSDevicePort, gem5::SMMUControlPort, gem5::SMMUDevicePort, gem5::VegaTLBCoalescer::CpuSidePort, gem5::VegaISA::GpuTLB::CpuSidePort, gem5::TLBCoalescer::CpuSidePort, and gem5::X86ISA::GpuTLB::CpuSidePort.

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

◆ 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 gem5::SysBridge::SysBridgeSourcePort, and 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 191 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 184 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(), gem5::CommMonitor::recvAtomicSnoop(), and gem5::SysBridge::SysBridgeTargetPort::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::AddrMapper::recvFunctionalSnoop(), gem5::CommMonitor::recvFunctionalSnoop(), gem5::MemCheckerMonitor::recvFunctionalSnoop(), and gem5::SysBridge::SysBridgeTargetPort::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::SysBridge::SysBridgeTargetPort::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::AddrMapper::recvTimingSnoopReq(), gem5::CommMonitor::recvTimingSnoopReq(), gem5::MemCheckerMonitor::recvTimingSnoopReq(), gem5::SysBridge::SysBridgeTargetPort::recvTimingSnoopReq(), gem5::Cache::sendMSHRQueuePacket(), and gem5::OutgoingRequestBridge::sendTimingSnoopReq().

◆ tryTiming()

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

Availability request from the peer.

Implements gem5::TimingResponseProtocol.

Reimplemented in gem5::SysBridge::SysBridgeSourcePort, and 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 Wed Dec 21 2022 10:23:28 for gem5 by doxygen 1.9.1