gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Bridge::BridgeSlavePort Class Reference

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

#include <bridge.hh>

Inheritance diagram for Bridge::BridgeSlavePort:
SlavePort BaseSlavePort Port

Public Member Functions

 BridgeSlavePort (const std::string &_name, Bridge &_bridge, BridgeMasterPort &_masterPort, Cycles _delay, int _resp_limit, std::vector< AddrRange > _ranges)
 Constructor for the BridgeSlavePort. 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 SlavePort
 SlavePort (const std::string &name, MemObject *owner, PortID id=InvalidPortID)
 Slave port. More...
 
virtual ~SlavePort ()
 
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)
 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 master port by calling its corresponding receive function. More...
 
void sendTimingSnoopReq (PacketPtr pkt)
 Attempt to send a timing snoop request packet to the master port by calling its corresponding receive function. More...
 
void sendRetryReq ()
 Send a retry to the master port that previously attempted a sendTimingReq to this slave port and failed. More...
 
void sendRetrySnoopResp ()
 Send a retry to the master port that previously attempted a sendTimingSnoopResp to this slave port and failed. More...
 
bool isSnooping () const
 Find out if the peer master port is snooping or not. More...
 
void sendRangeChange () const
 Called by the owner to send a range change. More...
 
- Public Member Functions inherited from BaseSlavePort
BaseMasterPortgetMasterPort () const
 
bool isConnected () const
 
- Public Member Functions inherited from Port
const std::string name () const
 Return port name (for DPRINTF). More...
 
PortID getId () const
 Get the port id. 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 SlavePort
void unbind ()
 Called by the master port to unbind. More...
 
void bind (MasterPort &master_port)
 Called by the master port to bind. More...
 
virtual bool recvTimingSnoopResp (PacketPtr pkt)
 Receive a timing snoop response from the master port. More...
 
- Protected Member Functions inherited from BaseSlavePort
 BaseSlavePort (const std::string &name, MemObject *owner, PortID id=InvalidPortID)
 
virtual ~BaseSlavePort ()
 
- Protected Member Functions inherited from Port
 Port (const std::string &_name, MemObject &_owner, PortID _id)
 Abstract base class for ports. More...
 
virtual ~Port ()
 Virtual destructor due to inheritance. 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...
 
BridgeMasterPortmasterPort
 Master 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...
 
EventWrapper< BridgeSlavePort,&BridgeSlavePort::trySendTimingsendEvent
 Send event for the response queue. More...
 

Additional Inherited Members

- Protected Attributes inherited from BaseSlavePort
BaseMasterPort_baseMasterPort
 
- Protected Attributes inherited from 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...
 
MemObjectowner
 A reference to the MemObject that owns this port. More...
 

Detailed Description

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

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

Definition at line 102 of file bridge.hh.

Constructor & Destructor Documentation

Bridge::BridgeSlavePort::BridgeSlavePort ( const std::string &  _name,
Bridge _bridge,
BridgeMasterPort _masterPort,
Cycles  _delay,
int  _resp_limit,
std::vector< AddrRange _ranges 
)

Constructor for the BridgeSlavePort.

Parameters
_namethe port name including the owner
_bridgethe structural owner
_masterPortthe master 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 57 of file bridge.cc.

Member Function Documentation

AddrRangeList Bridge::BridgeSlavePort::getAddrRanges ( ) const
protectedvirtual

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

Implements SlavePort.

Definition at line 398 of file bridge.cc.

Tick Bridge::BridgeSlavePort::recvAtomic ( PacketPtr  pkt)
protectedvirtual

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

Implements SlavePort.

Definition at line 348 of file bridge.cc.

References Packet::cacheResponding(), Bridge::masterPort, panic_if(), and MasterPort::sendAtomic().

void Bridge::BridgeSlavePort::recvFunctional ( PacketPtr  pkt)
protectedvirtual

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

Implements SlavePort.

Definition at line 357 of file bridge.cc.

References Bridge::BridgeMasterPort::checkFunctional(), Packet::checkFunctional(), ArmISA::i, Packet::makeResponse(), Bridge::masterPort, SimObject::name(), Packet::popLabel(), Packet::pushLabel(), and MasterPort::sendFunctional().

void Bridge::BridgeSlavePort::recvRespRetry ( )
protectedvirtual

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

Implements SlavePort.

Definition at line 342 of file bridge.cc.

bool Bridge::BridgeSlavePort::recvTimingReq ( PacketPtr  pkt)
protectedvirtual
bool Bridge::BridgeSlavePort::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 119 of file bridge.cc.

References outstandingResponses, and respQueueLimit.

void Bridge::BridgeSlavePort::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 213 of file bridge.cc.

References DPRINTF.

Referenced by Bridge::BridgeMasterPort::trySendTiming().

void Bridge::BridgeSlavePort::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 240 of file bridge.cc.

Referenced by Bridge::BridgeMasterPort::recvTimingResp().

void Bridge::BridgeSlavePort::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 292 of file bridge.cc.

References curTick(), DPRINTF, Packet::getAddr(), Bridge::masterPort, Bridge::BridgeMasterPort::reqQueueFull(), and Bridge::DeferredPacket::tick.

Member Data Documentation

Bridge& Bridge::BridgeSlavePort::bridge
private

The bridge to which this port belongs.

Definition at line 108 of file bridge.hh.

const Cycles Bridge::BridgeSlavePort::delay
private

Minimum request delay though this bridge.

Definition at line 116 of file bridge.hh.

BridgeMasterPort& Bridge::BridgeSlavePort::masterPort
private

Master port on the other side of the bridge.

Definition at line 113 of file bridge.hh.

unsigned int Bridge::BridgeSlavePort::outstandingResponses
private

Counter to track the outstanding responses.

Definition at line 130 of file bridge.hh.

Referenced by respQueueFull().

std::unique_ptr<Packet> Bridge::BridgeSlavePort::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.

const AddrRangeList Bridge::BridgeSlavePort::ranges
private

Address ranges to pass through the bridge.

Definition at line 119 of file bridge.hh.

unsigned int Bridge::BridgeSlavePort::respQueueLimit
private

Max queue size for reserved responses.

Definition at line 136 of file bridge.hh.

Referenced by respQueueFull().

bool Bridge::BridgeSlavePort::retryReq
private

If we should send a retry when space becomes available.

Definition at line 133 of file bridge.hh.

EventWrapper<BridgeSlavePort, &BridgeSlavePort::trySendTiming> Bridge::BridgeSlavePort::sendEvent
private

Send event for the response queue.

Definition at line 160 of file bridge.hh.

std::deque<DeferredPacket> Bridge::BridgeSlavePort::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 Fri Jun 9 2017 13:04:04 for gem5 by doxygen 1.8.6