gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::ResponsePortWrapper Class Reference

The ResponsePortWrapper converts inherit-based ResponsePort into callback-based. More...

#include <port_wrapper.hh>

Inheritance diagram for gem5::ResponsePortWrapper:
gem5::ResponsePort gem5::Port gem5::AtomicResponseProtocol gem5::TimingResponseProtocol gem5::FunctionalResponseProtocol

Public Types

using GetAddrRangesCallback = std::function<AddrRangeList()>
 
using RecvTimingReqCallback = std::function<bool(PacketPtr)>
 
using RecvAtomicCallback = std::function<Tick(PacketPtr)>
 
using RecvAtomicBackdoorCallback
 
using RecvFunctionalCallback = std::function<void(PacketPtr)>
 
using RecvMemBackdoorReqCallback
 
using RecvRespRetryCallback = std::function<void()>
 

Public Member Functions

 ResponsePortWrapper (const std::string &name, PortID id=InvalidPortID)
 
AddrRangeList getAddrRanges () const override
 Get a list of the non-overlapping address ranges the owner is responsible for.
 
bool recvTimingReq (PacketPtr) override
 Receive a timing request from the peer.
 
void recvRespRetry () override
 Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called on the peer) and was unsuccessful.
 
Tick recvAtomic (PacketPtr) override
 Receive an atomic request packet from the peer.
 
Tick recvAtomicBackdoor (PacketPtr, MemBackdoorPtr &) override
 Default implementations.
 
void recvFunctional (PacketPtr) override
 Receive a functional request packet from the peer.
 
void recvMemBackdoorReq (const MemBackdoorReq &, MemBackdoorPtr &) override
 Receive a request for a back door to a range of memory.
 
void setGetAddrRangesCallback (GetAddrRangesCallback)
 
void setTimingCallbacks (RecvTimingReqCallback, RecvRespRetryCallback)
 
void setAtomicCallbacks (RecvAtomicCallback, RecvAtomicBackdoorCallback=nullptr)
 
void setFunctionalCallbacks (RecvFunctionalCallback, RecvMemBackdoorReqCallback=nullptr)
 
- Public Member Functions inherited from gem5::ResponsePort
 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.
 
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.
 

Private Attributes

GetAddrRangesCallback getAddrRangesCb = nullptr
 
RecvTimingReqCallback recvTimingReqCb = nullptr
 
RecvRespRetryCallback recvRespRetryCb = nullptr
 
RecvAtomicCallback recvAtomicCb = nullptr
 
RecvAtomicBackdoorCallback recvAtomicBackdoorCb = nullptr
 
RecvFunctionalCallback recvFunctionalCb = nullptr
 
RecvMemBackdoorReqCallback recvMemBackdoorReqCb = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from gem5::ResponsePort
void responderUnbind ()
 Called by the request port to unbind.
 
void responderBind (RequestPort &request_port)
 Called by the request port to bind.
 
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.
 
- 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.
 
- 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.
 
- Protected Attributes inherited from gem5::ResponsePort
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.
 

Detailed Description

The ResponsePortWrapper converts inherit-based ResponsePort into callback-based.

Definition at line 104 of file port_wrapper.hh.

Member Typedef Documentation

◆ GetAddrRangesCallback

Definition at line 107 of file port_wrapper.hh.

◆ RecvAtomicBackdoorCallback

Initial value:
std::function<Tick(PacketPtr, MemBackdoorPtr&)>
MemBackdoor * MemBackdoorPtr
Definition backdoor.hh:127
uint64_t Tick
Tick count type.
Definition types.hh:58
Packet * PacketPtr

Definition at line 112 of file port_wrapper.hh.

◆ RecvAtomicCallback

Definition at line 111 of file port_wrapper.hh.

◆ RecvFunctionalCallback

Definition at line 116 of file port_wrapper.hh.

◆ RecvMemBackdoorReqCallback

Initial value:
std::function<void(const MemBackdoorReq&, MemBackdoorPtr&)>

Definition at line 117 of file port_wrapper.hh.

◆ RecvRespRetryCallback

using gem5::ResponsePortWrapper::RecvRespRetryCallback = std::function<void()>

Definition at line 120 of file port_wrapper.hh.

◆ RecvTimingReqCallback

Definition at line 109 of file port_wrapper.hh.

Constructor & Destructor Documentation

◆ ResponsePortWrapper()

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

Definition at line 76 of file port_wrapper.cc.

Member Function Documentation

◆ getAddrRanges()

AddrRangeList gem5::ResponsePortWrapper::getAddrRanges ( ) const
overridevirtual

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

Implements gem5::ResponsePort.

Definition at line 82 of file port_wrapper.cc.

References getAddrRangesCb, and panic_if.

◆ recvAtomic()

Tick gem5::ResponsePortWrapper::recvAtomic ( PacketPtr pkt)
overridevirtual

Receive an atomic request packet from the peer.

Implements gem5::AtomicResponseProtocol.

Definition at line 103 of file port_wrapper.cc.

References panic_if, and recvAtomicCb.

◆ recvAtomicBackdoor()

Tick gem5::ResponsePortWrapper::recvAtomicBackdoor ( PacketPtr pkt,
MemBackdoorPtr & backdoor )
overridevirtual

Default implementations.

Reimplemented from gem5::ResponsePort.

Definition at line 110 of file port_wrapper.cc.

References gem5::ResponsePort::recvAtomicBackdoor(), and recvAtomicBackdoorCb.

◆ recvFunctional()

void gem5::ResponsePortWrapper::recvFunctional ( PacketPtr pkt)
overridevirtual

Receive a functional request packet from the peer.

Implements gem5::FunctionalResponseProtocol.

Definition at line 120 of file port_wrapper.cc.

References panic_if, and recvFunctionalCb.

◆ recvMemBackdoorReq()

void gem5::ResponsePortWrapper::recvMemBackdoorReq ( const MemBackdoorReq & req,
MemBackdoorPtr & backdoor )
overridevirtual

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.

Reimplemented from gem5::ResponsePort.

Definition at line 127 of file port_wrapper.cc.

References gem5::ResponsePort::recvMemBackdoorReq(), and recvMemBackdoorReqCb.

◆ recvRespRetry()

void gem5::ResponsePortWrapper::recvRespRetry ( )
overridevirtual

Called by the peer if sendTimingResp was called on this protocol (causing recvTimingResp to be called on the peer) and was unsuccessful.

Implements gem5::TimingResponseProtocol.

Definition at line 96 of file port_wrapper.cc.

References panic_if, and recvRespRetryCb.

◆ recvTimingReq()

bool gem5::ResponsePortWrapper::recvTimingReq ( PacketPtr pkt)
overridevirtual

Receive a timing request from the peer.

Implements gem5::TimingResponseProtocol.

Definition at line 89 of file port_wrapper.cc.

References panic_if, and recvTimingReqCb.

◆ setAtomicCallbacks()

void gem5::ResponsePortWrapper::setAtomicCallbacks ( RecvAtomicCallback atomic_cb,
RecvAtomicBackdoorCallback backdoor_cb = nullptr )

Definition at line 152 of file port_wrapper.cc.

References recvAtomicBackdoorCb, and recvAtomicCb.

◆ setFunctionalCallbacks()

void gem5::ResponsePortWrapper::setFunctionalCallbacks ( RecvFunctionalCallback func_cb,
RecvMemBackdoorReqCallback backdoor_cb = nullptr )

Definition at line 160 of file port_wrapper.cc.

References recvFunctionalCb, and recvMemBackdoorReqCb.

◆ setGetAddrRangesCallback()

void gem5::ResponsePortWrapper::setGetAddrRangesCallback ( GetAddrRangesCallback cb)

Definition at line 138 of file port_wrapper.cc.

References getAddrRangesCb.

◆ setTimingCallbacks()

void gem5::ResponsePortWrapper::setTimingCallbacks ( RecvTimingReqCallback timing_cb,
RecvRespRetryCallback retry_cb )

Definition at line 144 of file port_wrapper.cc.

References recvRespRetryCb, and recvTimingReqCb.

Member Data Documentation

◆ getAddrRangesCb

GetAddrRangesCallback gem5::ResponsePortWrapper::getAddrRangesCb = nullptr
private

Definition at line 146 of file port_wrapper.hh.

Referenced by getAddrRanges(), and setGetAddrRangesCallback().

◆ recvAtomicBackdoorCb

RecvAtomicBackdoorCallback gem5::ResponsePortWrapper::recvAtomicBackdoorCb = nullptr
private

Definition at line 150 of file port_wrapper.hh.

Referenced by recvAtomicBackdoor(), and setAtomicCallbacks().

◆ recvAtomicCb

RecvAtomicCallback gem5::ResponsePortWrapper::recvAtomicCb = nullptr
private

Definition at line 149 of file port_wrapper.hh.

Referenced by recvAtomic(), and setAtomicCallbacks().

◆ recvFunctionalCb

RecvFunctionalCallback gem5::ResponsePortWrapper::recvFunctionalCb = nullptr
private

Definition at line 151 of file port_wrapper.hh.

Referenced by recvFunctional(), and setFunctionalCallbacks().

◆ recvMemBackdoorReqCb

RecvMemBackdoorReqCallback gem5::ResponsePortWrapper::recvMemBackdoorReqCb = nullptr
private

Definition at line 152 of file port_wrapper.hh.

Referenced by recvMemBackdoorReq(), and setFunctionalCallbacks().

◆ recvRespRetryCb

RecvRespRetryCallback gem5::ResponsePortWrapper::recvRespRetryCb = nullptr
private

Definition at line 148 of file port_wrapper.hh.

Referenced by recvRespRetry(), and setTimingCallbacks().

◆ recvTimingReqCb

RecvTimingReqCallback gem5::ResponsePortWrapper::recvTimingReqCb = nullptr
private

Definition at line 147 of file port_wrapper.hh.

Referenced by recvTimingReq(), and setTimingCallbacks().


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