gem5
|
The port on the side that receives requests and sends responses. More...
#include <serial_link.hh>
Public Member Functions | |
SerialLinkSlavePort (const std::string &_name, SerialLink &_serial_link, SerialLinkMasterPort &_masterPort, Cycles _delay, int _resp_limit, const std::vector< AddrRange > &_ranges) | |
Constructor for the SerialLinkSlavePort. 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 | |
BaseMasterPort & | getMasterPort () 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 serial_link. More... | |
void | recvRespRetry () |
When receiving a retry request from the peer port, pass it to the serial_link. More... | |
Tick | recvAtomic (PacketPtr pkt) |
When receiving a Atomic requestfrom the peer port, pass it to the serial_link. More... | |
void | recvFunctional (PacketPtr pkt) |
When receiving a Functional request from the peer port, pass it to the serial_link. More... | |
AddrRangeList | getAddrRanges () const |
When receiving a address range request the peer port, pass it to the serial_link. 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 | |
SerialLink & | serial_link |
The serial_link to which this port belongs. More... | |
SerialLinkMasterPort & | masterPort |
Master port on the other side of the serial_link. More... | |
const Cycles | delay |
Minimum request delay though this serial_link. More... | |
const AddrRangeList | ranges |
Address ranges to pass through the serial_link. More... | |
std::deque< DeferredPacket > | transmitList |
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... | |
EventWrapper < SerialLinkSlavePort,&SerialLinkSlavePort::trySendTiming > | sendEvent |
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... | |
MemObject & | owner |
A reference to the MemObject that owns this port. More... | |
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 98 of file serial_link.hh.
SerialLink::SerialLinkSlavePort::SerialLinkSlavePort | ( | const std::string & | _name, |
SerialLink & | _serial_link, | ||
SerialLinkMasterPort & | _masterPort, | ||
Cycles | _delay, | ||
int | _resp_limit, | ||
const std::vector< AddrRange > & | _ranges | ||
) |
Constructor for the SerialLinkSlavePort.
_name | the port name including the owner |
_serial_link | the structural owner |
_masterPort | the master port on the other side of the serial_link |
_delay | the delay in cycles from receiving to sending |
_resp_limit | the size of the response queue |
_ranges | a number of address ranges to forward |
Definition at line 59 of file serial_link.cc.
|
protectedvirtual |
When receiving a address range request the peer port, pass it to the serial_link.
Implements SlavePort.
Definition at line 430 of file serial_link.cc.
When receiving a Atomic requestfrom the peer port, pass it to the serial_link.
Implements SlavePort.
Definition at line 383 of file serial_link.cc.
References SerialLink::masterPort, and MasterPort::sendAtomic().
|
protectedvirtual |
When receiving a Functional request from the peer port, pass it to the serial_link.
Implements SlavePort.
Definition at line 389 of file serial_link.cc.
References SerialLink::SerialLinkMasterPort::checkFunctional(), Packet::checkFunctional(), ArmISA::i, Packet::makeResponse(), SerialLink::masterPort, SimObject::name(), Packet::popLabel(), Packet::pushLabel(), and MasterPort::sendFunctional().
|
protectedvirtual |
When receiving a retry request from the peer port, pass it to the serial_link.
Implements SlavePort.
Definition at line 377 of file serial_link.cc.
|
protectedvirtual |
When receiving a timing request from the peer port, pass it to the serial_link.
Implements SlavePort.
Definition at line 172 of file serial_link.cc.
References Packet::cacheResponding(), Packet::cmdString(), divCeil(), DPRINTF, Packet::getAddr(), Packet::getSize(), Packet::headerDelay, SerialLink::masterPort, Packet::needsResponse(), Packet::payloadDelay, SerialLink::SerialLinkMasterPort::reqQueueFull(), SerialLink::SerialLinkMasterPort::schedTimingReq(), and ArmISA::t.
|
private |
Is this side blocked from accepting new response packets.
Definition at line 127 of file serial_link.cc.
References outstandingResponses, and respQueueLimit.
void SerialLink::SerialLinkSlavePort::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 239 of file serial_link.cc.
References DPRINTF.
Referenced by SerialLink::SerialLinkMasterPort::trySendTiming().
Queue a response packet to be sent out later and also schedule a send if necessary.
pkt | a response to send out after a delay |
when | tick when response packet should be sent |
Definition at line 266 of file serial_link.cc.
Referenced by SerialLink::SerialLinkMasterPort::recvTimingResp().
|
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 323 of file serial_link.cc.
References curTick(), divCeil(), DPRINTF, Packet::getAddr(), Packet::getSize(), SerialLink::masterPort, SerialLink::SerialLinkMasterPort::reqQueueFull(), ArmISA::t, and SerialLink::DeferredPacket::tick.
|
private |
Minimum request delay though this serial_link.
Definition at line 112 of file serial_link.hh.
|
private |
Master port on the other side of the serial_link.
Definition at line 109 of file serial_link.hh.
|
private |
Counter to track the outstanding responses.
Definition at line 126 of file serial_link.hh.
Referenced by respQueueFull().
|
private |
Address ranges to pass through the serial_link.
Definition at line 115 of file serial_link.hh.
|
private |
Max queue size for reserved responses.
Definition at line 132 of file serial_link.hh.
Referenced by respQueueFull().
|
private |
If we should send a retry when space becomes available.
Definition at line 129 of file serial_link.hh.
|
private |
Send event for the response queue.
Definition at line 150 of file serial_link.hh.
|
private |
The serial_link to which this port belongs.
Definition at line 104 of file serial_link.hh.
|
private |
Response packet queue.
Response packets are held in this queue for a specified delay to model the processing delay of the serial_link. We use a deque as we need to iterate over the items for functional accesses.
Definition at line 123 of file serial_link.hh.