gem5 v24.0.0.0
Loading...
Searching...
No Matches
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::ResponsePortWrapper 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.
 
 ResponsePort (const std::string &name, PortID id=InvalidPortID)
 
virtual ~ResponsePort ()
 
bool isSnooping () const
 Find out if the peer request port is snooping or not.
 
void sendRangeChange () const
 Called by the owner to send a range change.
 
virtual AddrRangeList getAddrRanges () const =0
 Get a list of the non-overlapping address ranges the owner is responsible for.
 
void unbind () override
 We let the request port do the work, so these don't do anything.
 
void bind (Port &peer) override
 Attach to a peer port.
 
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.
 
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.
 
bool sendTimingResp (PacketPtr pkt)
 Attempt to send a timing response to the request port by calling its corresponding receive function.
 
void sendTimingSnoopReq (PacketPtr pkt)
 Attempt to send a timing snoop request packet to the request port by calling its corresponding receive function.
 
void sendRetryReq ()
 Send a retry to the request port that previously attempted a sendTimingReq to this response port and failed.
 
void sendRetrySnoopResp ()
 Send a retry to the request port that previously attempted a sendTimingSnoopResp to this response port and failed.
 
- Public Member Functions inherited from gem5::Port
virtual ~Port ()
 Virtual destructor due to inheritance.
 
PortgetPeer ()
 Return a reference to this port's peer.
 
const std::string name () const
 Return port name (for DPRINTF).
 
PortID getId () const
 Get the port id.
 
bool isConnected () const
 Is this port currently connected to a peer?
 
void takeOverFrom (Port *old)
 A utility function to make it easier to swap out ports.
 

Protected Member Functions

void responderUnbind ()
 Called by the request port to unbind.
 
void responderBind (RequestPort &request_port)
 Called by the request port to bind.
 
Tick recvAtomicBackdoor (PacketPtr pkt, MemBackdoorPtr &backdoor) override
 Default implementations.
 
void recvMemBackdoorReq (const MemBackdoorReq &req, MemBackdoorPtr &backdoor) override
 Receive a request for a back door to a range of memory.
 
bool tryTiming (PacketPtr pkt) override
 Availability request from the peer.
 
bool recvTimingSnoopResp (PacketPtr pkt) override
 Receive a timing snoop response from the peer.
 
- Protected Member Functions inherited from gem5::Port
void reportUnbound () const
 
 Port (const std::string &_name, PortID _id)
 Abstract base class for ports.
 
- 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.
 
virtual Tick recvAtomic (PacketPtr pkt)=0
 Receive an atomic request packet from the peer.
 
- 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.
 
void sendSnoopReq (TimingRequestProtocol *peer, PacketPtr pkt)
 Attempt to send a timing snoop request packet to the peer by calling its corresponding receive function.
 
void sendRetryReq (TimingRequestProtocol *peer)
 Send a retry to the peer that previously attempted a sendTimingReq to this protocol and failed.
 
void sendRetrySnoopResp (TimingRequestProtocol *peer)
 Send a retry to the peer that previously attempted a sendTimingSnoopResp to this peer and failed.
 
virtual bool recvTimingReq (PacketPtr pkt)=0
 Receive a timing request from the peer.
 
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.
 
- 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.
 
virtual void recvFunctional (PacketPtr pkt)=0
 Receive a functional request packet from the peer.
 

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.
 
Port_peer
 A pointer to this port's peer.
 
bool _connected
 Whether this port is currently connected to a peer port.
 

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 347 of file port.hh.

Constructor & Destructor Documentation

◆ ResponsePort() [1/2]

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

Response port.

Definition at line 218 of file port.cc.

◆ ResponsePort() [2/2]

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

Definition at line 235 of file port.cc.

◆ ~ResponsePort()

gem5::ResponsePort::~ResponsePort ( )
virtual

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

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

◆ isSnooping()

◆ recvAtomicBackdoor()

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

◆ recvMemBackdoorReq()

void gem5::ResponsePort::recvMemBackdoorReq ( const MemBackdoorReq & req,
MemBackdoorPtr & backdoor )
overrideprotectedvirtual

Receive a request for a back door to a range of memory.

Parameters
reqAn object which describes what back door is being requested.
backdoorCan be set to a back door pointer by the target to let caller have direct access to the requested range.

Implements gem5::FunctionalResponseProtocol.

Reimplemented in gem5::ResponsePortWrapper, and gem5::SysBridge::SysBridgeSourcePort.

Definition at line 273 of file port.cc.

References defaultBackdoorWarned, DPRINTF, and gem5::Port::name().

Referenced by gem5::ResponsePortWrapper::recvMemBackdoorReq().

◆ recvTimingSnoopResp()

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

Receive a timing snoop response from the peer.

Implements gem5::TimingResponseProtocol.

Reimplemented in gem5::StubSlavePort, and gem5::SysBridge::SysBridgeSourcePort.

Definition at line 539 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 255 of file port.cc.

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

◆ responderUnbind()

void gem5::ResponsePort::responderUnbind ( )
protected

Called by the request port to unbind.

Should never be called directly.

Definition at line 248 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 410 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 430 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()

◆ sendRetryReq()

◆ 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 503 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()

◆ 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 475 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.

Definition at line 533 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 394 of file port.hh.

Friends And Related Symbol Documentation

◆ RequestPort

friend class RequestPort
friend

Definition at line 350 of file port.hh.

Member Data Documentation

◆ _requestPort

◆ defaultBackdoorWarned

bool gem5::ResponsePort::defaultBackdoorWarned
private

Definition at line 355 of file port.hh.

Referenced by recvAtomicBackdoor(), and recvMemBackdoorReq().

◆ owner

SimObject& gem5::ResponsePort::owner
protected

Definition at line 358 of file port.hh.


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

Generated on Tue Jun 18 2024 16:24:14 for gem5 by doxygen 1.11.0