gem5
v20.1.0.0
|
A ResponsePort is a specialization of a port. More...
#include <port.hh>
Public Member Functions | |
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... | |
virtual AddrRangeList | getAddrRanges () const =0 |
Get a list of the non-overlapping address ranges the owner is responsible for. 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 Port | |
virtual | ~Port () |
Virtual destructor due to inheritance. More... | |
Port & | getPeer () |
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 | |
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 Port | |
void | reportUnbound () const |
Port (const std::string &_name, PortID _id) | |
Abstract base class for ports. More... | |
Protected Member Functions inherited from 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... | |
virtual Tick | recvAtomic (PacketPtr pkt)=0 |
Receive an atomic request packet from the peer. More... | |
Protected Member Functions inherited from 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... | |
virtual bool | recvTimingReq (PacketPtr pkt)=0 |
Receive a timing request from the peer. More... | |
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. More... | |
Protected Member Functions inherited from 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... | |
virtual void | recvFunctional (PacketPtr pkt)=0 |
Receive a functional request packet from the peer. More... | |
Protected Attributes | |
SimObject & | owner |
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... | |
Port * | _peer |
A pointer to this port's peer. More... | |
bool | _connected |
Whether this port is currently connected to a peer port. More... | |
Private Attributes | |
RequestPort * | _requestPort |
bool | defaultBackdoorWarned |
Friends | |
class | RequestPort |
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.
ResponsePort::ResponsePort | ( | const std::string & | name, |
SimObject * | _owner, | ||
PortID | id = InvalidPortID |
||
) |
|
inlineoverridevirtual |
|
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.
Implemented in BaseCache::CpuSidePort, CoherentXBar::CoherentXBarResponsePort, NoncoherentXBar::NoncoherentXBarResponsePort, MemDelay::ResponsePort, SimpleMemory::MemoryPort, SimpleCache::CPUSidePort, sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort, SimpleMemobj::CPUSidePort, PioPort< Device >, MemCtrl::MemoryPort, X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorResponsePort, GPUCoalescer::GMTokenPort, Bridge::BridgeResponsePort, SerialLink::SerialLinkResponsePort, LdsState::CuSidePort, AddrMapper::MapperResponsePort, MemCheckerMonitor::MonitorResponsePort, TLBCoalescer::CpuSidePort, RubyPort::PioResponsePort, SMMUATSDevicePort, QoS::MemSinkCtrl::MemoryPort, SMMUControlPort, RubyPort::MemResponsePort, SMMUDevicePort, DRAMsim3::MemoryPort, ExternalSlave::ExternalPort, DRAMSim2::MemoryPort, and X86ISA::IntResponsePort< Device >.
Referenced by RequestPort::getAddrRanges().
|
inline |
Find out if the peer request port is snooping or not.
Definition at line 288 of file port.hh.
References _requestPort, and RequestPort::isSnooping().
Referenced by BaseCache::functionalAccess(), BaseCache::init(), MemDelay::RequestPort::isSnooping(), MemCheckerMonitor::isSnooping(), AddrMapper::isSnooping(), CommMonitor::isSnooping(), SnoopFilter::lookupRequest(), SnoopFilter::portToMask(), SnoopFilter::updateResponse(), and SnoopFilter::updateSnoopResponse().
|
overrideprotectedvirtual |
Default implementations.
Implements AtomicResponseProtocol.
Reimplemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort, and SimpleMemory::MemoryPort.
Definition at line 194 of file port.cc.
References defaultBackdoorWarned, Port::name(), AtomicResponseProtocol::recvAtomic(), and warn.
|
inlineoverrideprotectedvirtual |
Receive a timing snoop response from the peer.
Implements TimingResponseProtocol.
Reimplemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort.
Definition at line 446 of file port.hh.
References Port::name(), and panic.
|
protected |
Called by the request port to bind.
Should never be called directly.
Definition at line 187 of file port.cc.
References _requestPort, and Port::bind().
Referenced by RequestPort::bind().
|
protected |
Called by the request port to unbind.
Should never be called directly.
Definition at line 180 of file port.cc.
References _requestPort, and Port::unbind().
Referenced by RequestPort::unbind(), and TokenResponsePort::unbind().
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.
pkt | Snoop packet to send. |
Definition at line 323 of file port.hh.
References _requestPort, Port::reportUnbound(), and AtomicResponseProtocol::sendSnoop().
Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), AddrMapper::recvAtomicSnoop(), and CommMonitor::recvAtomicSnoop().
|
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.
pkt | Snoop packet to send. |
Definition at line 343 of file port.hh.
References _requestPort, Port::reportUnbound(), and FunctionalResponseProtocol::sendSnoop().
Referenced by BaseCache::functionalAccess(), MemCheckerMonitor::recvFunctionalSnoop(), AddrMapper::recvFunctionalSnoop(), and CommMonitor::recvFunctionalSnoop().
|
inline |
Called by the owner to send a range change.
Definition at line 293 of file port.hh.
References _requestPort, and RequestPort::recvRangeChange().
Referenced by ExternalSlave::init(), PioDevice::init(), QoS::MemSinkCtrl::init(), SMMUv3::init(), SimpleMemory::init(), DRAMSim2::init(), DRAMsim3::init(), SerialLink::init(), Bridge::init(), MemCtrl::init(), BaseCache::init(), MemDelay::RequestPort::recvRangeChange(), MemCheckerMonitor::recvRangeChange(), AddrMapper::recvRangeChange(), CommMonitor::recvRangeChange(), SMMUv3DeviceInterface::sendRange(), SimpleMemobj::sendRangeChange(), PciDevice::unserialize(), Sinic::Device::unserialize(), and PciDevice::writeConfig().
|
inline |
Send a retry to the request port that previously attempted a sendTimingReq to this response port and failed.
Definition at line 398 of file port.hh.
References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendRetryReq().
Referenced by SMMUv3DeviceInterface::atsSendDeviceRetry(), QoS::MemSinkCtrl::processNextReqEvent(), MemCtrl::processNextReqEvent(), MemCtrl::processRespondEvent(), StubSlavePort::processResponseEvent(), MemCheckerMonitor::recvReqRetry(), AddrMapper::recvReqRetry(), CommMonitor::recvReqRetry(), SimpleMemory::release(), SMMUv3DeviceInterface::sendDeviceRetry(), BaseXBar::ReqLayer::sendRetry(), DRAMSim2::tick(), and DRAMsim3::tick().
|
inline |
Send a retry to the request port that previously attempted a sendTimingSnoopResp to this response port and failed.
Definition at line 412 of file port.hh.
References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendRetrySnoopResp().
Referenced by CommMonitor::recvRetrySnoopResp(), BaseXBar::SnoopRespLayer::sendRetry(), and CoherentXBar::SnoopRespPort::sendRetryResp().
|
inline |
Attempt to send a timing response to the request port by calling its corresponding receive function.
If the send does not succeed, as indicated by the return value, then the sender must wait for a recvRespRetry at which point it can re-issue a sendTimingResp.
pkt | Packet to send. |
Definition at line 367 of file port.hh.
References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendResp().
Referenced by PendingWriteInst::ackWriteCompletion(), SimpleMemory::dequeue(), LdsState::process(), StubSlavePort::processResponseEvent(), TokenResponsePort::recvRespRetry(), MemCheckerMonitor::recvTimingResp(), AddrMapper::recvTimingResp(), CommMonitor::recvTimingResp(), SimpleMemobj::CPUSidePort::sendPacket(), SimpleCache::CPUSidePort::sendPacket(), DRAMSim2::sendResponse(), DRAMsim3::sendResponse(), RespPacketQueue::sendTiming(), TokenResponsePort::sendTimingResp(), and TLBCoalescer::updatePhysAddresses().
|
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.
pkt | Packet to send. |
Definition at line 384 of file port.hh.
References _requestPort, Port::reportUnbound(), and TimingResponseProtocol::sendSnoopReq().
Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvTimingSnoopReq(), AddrMapper::recvTimingSnoopReq(), CommMonitor::recvTimingSnoopReq(), and Cache::sendMSHRQueuePacket().
|
inlineoverrideprotectedvirtual |
Availability request from the peer.
Implements TimingResponseProtocol.
Reimplemented in sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort.
Definition at line 440 of file port.hh.
References Port::name(), and panic.
|
inlineoverridevirtual |
We let the request port do the work, so these don't do anything.
Reimplemented from Port.
Reimplemented in TokenResponsePort.
|
friend |
|
private |
Definition at line 271 of file port.hh.
Referenced by isSnooping(), responderBind(), responderUnbind(), sendAtomicSnoop(), sendFunctionalSnoop(), sendRangeChange(), sendRetryReq(), sendRetrySnoopResp(), sendTimingResp(), and sendTimingSnoopReq().
|
private |
Definition at line 273 of file port.hh.
Referenced by recvAtomicBackdoor().
|
protected |
Definition at line 276 of file port.hh.
Referenced by BaseCache::CacheResponsePort::setBlocked().