gem5  v21.1.0.2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
gem5::Bridge::BridgeResponsePort Class Reference

The port on the side that receives requests and sends responses. More...

#include <bridge.hh>

Inheritance diagram for gem5::Bridge::BridgeResponsePort:
gem5::ResponsePort gem5::Port gem5::AtomicResponseProtocol gem5::TimingResponseProtocol gem5::FunctionalResponseProtocol

Public Member Functions

 BridgeResponsePort (const std::string &_name, Bridge &_bridge, BridgeRequestPort &_memSidePort, Cycles _delay, int _resp_limit, std::vector< AddrRange > _ranges)
 Constructor for the BridgeResponsePort. More...
 
void schedTimingResp (PacketPtr pkt, Tick when)
 Queue a response packet to be sent out later and also schedule a send if necessary. More...
 
void retryStalledReq ()
 Retry any stalled request that we have failed to accept at an earlier point in time. More...
 
- Public Member Functions inherited from gem5::ResponsePort
 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...
 
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

bool recvTimingReq (PacketPtr pkt)
 When receiving a timing request from the peer port, pass it to the bridge. More...
 
void recvRespRetry ()
 When receiving a retry request from the peer port, pass it to the bridge. More...
 
Tick recvAtomic (PacketPtr pkt)
 When receiving a Atomic requestfrom the peer port, pass it to the bridge. More...
 
void recvFunctional (PacketPtr pkt)
 When receiving a Functional request from the peer port, pass it to the bridge. More...
 
AddrRangeList getAddrRanges () const
 When receiving a address range request the peer port, pass it to the bridge. More...
 
- Protected Member Functions inherited from gem5::ResponsePort
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...
 
- 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...
 
- 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...
 

Private Member Functions

bool respQueueFull () const
 Is this side blocked from accepting new response packets. More...
 
void trySendTiming ()
 Handle send event, scheduled when the packet at the head of the response queue is ready to transmit (for timing accesses only). More...
 

Private Attributes

Bridgebridge
 The bridge to which this port belongs. More...
 
BridgeRequestPortmemSidePort
 Request port on the other side of the bridge. More...
 
const Cycles delay
 Minimum request delay though this bridge. More...
 
const AddrRangeList ranges
 Address ranges to pass through the bridge. More...
 
std::deque< DeferredPackettransmitList
 Response packet queue. More...
 
unsigned int outstandingResponses
 Counter to track the outstanding responses. More...
 
bool retryReq
 If we should send a retry when space becomes available. More...
 
unsigned int respQueueLimit
 Max queue size for reserved responses. More...
 
std::unique_ptr< PacketpendingDelete
 Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call. More...
 
EventFunctionWrapper sendEvent
 Send event for the response queue. More...
 

Additional Inherited Members

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

Detailed Description

The port on the side that receives requests and sends responses.

The response port has a set of address ranges that it is responsible for. The response port also has a buffer for the responses not yet sent.

Definition at line 102 of file bridge.hh.

Constructor & Destructor Documentation

◆ BridgeResponsePort()

gem5::Bridge::BridgeResponsePort::BridgeResponsePort ( const std::string &  _name,
Bridge _bridge,
BridgeRequestPort _memSidePort,
Cycles  _delay,
int  _resp_limit,
std::vector< AddrRange _ranges 
)

Constructor for the BridgeResponsePort.

Parameters
_namethe port name including the owner
_bridgethe structural owner
_memSidePortthe request port on the other side of the bridge
_delaythe delay in cycles from receiving to sending
_resp_limitthe size of the response queue
_rangesa number of address ranges to forward

Definition at line 56 of file bridge.cc.

References trySendTiming().

Member Function Documentation

◆ getAddrRanges()

AddrRangeList gem5::Bridge::BridgeResponsePort::getAddrRanges ( ) const
protectedvirtual

When receiving a address range request the peer port, pass it to the bridge.

Implements gem5::ResponsePort.

Definition at line 392 of file bridge.cc.

◆ recvAtomic()

Tick gem5::Bridge::BridgeResponsePort::recvAtomic ( PacketPtr  pkt)
protectedvirtual

When receiving a Atomic requestfrom the peer port, pass it to the bridge.

Implements gem5::AtomicResponseProtocol.

Definition at line 342 of file bridge.cc.

References gem5::Packet::cacheResponding(), gem5::Bridge::memSidePort, panic_if, and gem5::RequestPort::sendAtomic().

◆ recvFunctional()

void gem5::Bridge::BridgeResponsePort::recvFunctional ( PacketPtr  pkt)
protectedvirtual

◆ recvRespRetry()

void gem5::Bridge::BridgeResponsePort::recvRespRetry ( )
protectedvirtual

When receiving a retry request from the peer port, pass it to the bridge.

Implements gem5::TimingResponseProtocol.

Definition at line 336 of file bridge.cc.

◆ recvTimingReq()

bool gem5::Bridge::BridgeResponsePort::recvTimingReq ( PacketPtr  pkt)
protectedvirtual

◆ respQueueFull()

bool gem5::Bridge::BridgeResponsePort::respQueueFull ( ) const
private

Is this side blocked from accepting new response packets.

Returns
true if the reserved space has reached the set limit

Definition at line 113 of file bridge.cc.

References outstandingResponses, and respQueueLimit.

◆ retryStalledReq()

void gem5::Bridge::BridgeResponsePort::retryStalledReq ( )

Retry any stalled request that we have failed to accept at an earlier point in time.

This call will do nothing if no request is waiting.

Definition at line 207 of file bridge.cc.

References DPRINTF.

Referenced by gem5::Bridge::BridgeRequestPort::trySendTiming().

◆ schedTimingResp()

void gem5::Bridge::BridgeResponsePort::schedTimingResp ( PacketPtr  pkt,
Tick  when 
)

Queue a response packet to be sent out later and also schedule a send if necessary.

Parameters
pkta response to send out after a delay
whentick when response packet should be sent

Definition at line 234 of file bridge.cc.

References gem5::ArmISA::sendEvent().

Referenced by gem5::Bridge::BridgeRequestPort::recvTimingResp().

◆ trySendTiming()

void gem5::Bridge::BridgeResponsePort::trySendTiming ( )
private

Handle send event, scheduled when the packet at the head of the response queue is ready to transmit (for timing accesses only).

Definition at line 286 of file bridge.cc.

References gem5::curTick(), DPRINTF, gem5::Packet::getAddr(), gem5::Bridge::memSidePort, gem5::Bridge::DeferredPacket::pkt, gem5::Bridge::BridgeRequestPort::reqQueueFull(), gem5::ArmISA::sendEvent(), and gem5::Bridge::DeferredPacket::tick.

Referenced by BridgeResponsePort().

Member Data Documentation

◆ bridge

Bridge& gem5::Bridge::BridgeResponsePort::bridge
private

The bridge to which this port belongs.

Definition at line 108 of file bridge.hh.

◆ delay

const Cycles gem5::Bridge::BridgeResponsePort::delay
private

Minimum request delay though this bridge.

Definition at line 116 of file bridge.hh.

◆ memSidePort

BridgeRequestPort& gem5::Bridge::BridgeResponsePort::memSidePort
private

Request port on the other side of the bridge.

Definition at line 113 of file bridge.hh.

◆ outstandingResponses

unsigned int gem5::Bridge::BridgeResponsePort::outstandingResponses
private

Counter to track the outstanding responses.

Definition at line 130 of file bridge.hh.

Referenced by respQueueFull().

◆ pendingDelete

std::unique_ptr<Packet> gem5::Bridge::BridgeResponsePort::pendingDelete
private

Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call.

Definition at line 142 of file bridge.hh.

◆ ranges

const AddrRangeList gem5::Bridge::BridgeResponsePort::ranges
private

Address ranges to pass through the bridge.

Definition at line 119 of file bridge.hh.

◆ respQueueLimit

unsigned int gem5::Bridge::BridgeResponsePort::respQueueLimit
private

Max queue size for reserved responses.

Definition at line 136 of file bridge.hh.

Referenced by respQueueFull().

◆ retryReq

bool gem5::Bridge::BridgeResponsePort::retryReq
private

If we should send a retry when space becomes available.

Definition at line 133 of file bridge.hh.

◆ sendEvent

EventFunctionWrapper gem5::Bridge::BridgeResponsePort::sendEvent
private

Send event for the response queue.

Definition at line 159 of file bridge.hh.

◆ transmitList

std::deque<DeferredPacket> gem5::Bridge::BridgeResponsePort::transmitList
private

Response packet queue.

Response packets are held in this queue for a specified delay to model the processing delay of the bridge. We use a deque as we need to iterate over the items for functional accesses.

Definition at line 127 of file bridge.hh.


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

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