gem5
|
A SlavePort is a specialisation of a port. More...
#include <port.hh>
Public Member Functions | |
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... | |
virtual AddrRangeList | getAddrRanges () const =0 |
Get a list of the non-overlapping address ranges the owner is responsible for. 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 | |
void | unbind () |
Called by the master port to unbind. More... | |
void | bind (MasterPort &master_port) |
Called by the master port to bind. More... | |
virtual Tick | recvAtomic (PacketPtr pkt)=0 |
Receive an atomic request packet from the master port. More... | |
virtual void | recvFunctional (PacketPtr pkt)=0 |
Receive a functional request packet from the master port. More... | |
virtual bool | recvTimingReq (PacketPtr pkt)=0 |
Receive a timing request from the master port. More... | |
virtual bool | recvTimingSnoopResp (PacketPtr pkt) |
Receive a timing snoop response from the master port. More... | |
virtual void | recvRespRetry ()=0 |
Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to be called on the master port) and was unsuccesful. 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 Attributes | |
MasterPort * | _masterPort |
Friends | |
class | MasterPort |
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... | |
A SlavePort is a specialisation of a port.
In addition to the basic functionality of sending packets to its master peer, it also has functions specific to a slave, e.g. to send range changes and get the address ranges that the port responds to.
SlavePort::SlavePort | ( | const std::string & | name, |
MemObject * | owner, | ||
PortID | id = InvalidPortID |
||
) |
|
protected |
Called by the master port to bind.
Should never be called directly.
Definition at line 230 of file port.cc.
References BaseSlavePort::_baseMasterPort, and _masterPort.
Referenced by MasterPort::bind().
|
pure virtual |
Get a list of the non-overlapping address ranges the owner is responsible for.
All slave ports must override this function and return a populated list with at least one item.
Implemented in X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorSlavePort, Bridge::BridgeSlavePort, SerialLink::SerialLinkSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, LdsState::CuSidePort, TLBCoalescer::CpuSidePort, CoherentXBar::CoherentXBarSlavePort, RubyPort::PioSlavePort, NoncoherentXBar::NoncoherentXBarSlavePort, DRAMCtrl::MemoryPort, SimpleMemory::MemoryPort, RubyPort::MemSlavePort, ExternalSlave::Port, DRAMSim2::MemoryPort, X86ISA::IntDevice::IntSlavePort, and PioPort.
Referenced by MasterPort::getAddrRanges().
|
inline |
Find out if the peer master port is snooping or not.
Definition at line 405 of file port.hh.
References _masterPort, and MasterPort::isSnooping().
Referenced by Cache::functionalAccess(), BaseCache::init(), MemCheckerMonitor::isSnooping(), AddrMapper::isSnooping(), CommMonitor::isSnooping(), SnoopFilter::lookupRequest(), SnoopFilter::portToMask(), SnoopFilter::updateResponse(), and SnoopFilter::updateSnoopResponse().
Receive an atomic request packet from the master port.
Implemented in X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorSlavePort, Bridge::BridgeSlavePort, SerialLink::SerialLinkSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, TLBCoalescer::CpuSidePort, LdsState::CuSidePort, RubyPort::PioSlavePort, CoherentXBar::CoherentXBarSlavePort, NoncoherentXBar::NoncoherentXBarSlavePort, DRAMCtrl::MemoryPort, SimpleMemory::MemoryPort, RubyPort::MemSlavePort, StubSlavePort, SimpleTimingPort, DRAMSim2::MemoryPort, MessageSlavePort, and PioPort.
Referenced by MasterPort::sendAtomic().
|
protectedpure virtual |
Receive a functional request packet from the master port.
Implemented in X86ISA::GpuTLB::CpuSidePort, Bridge::BridgeSlavePort, CommMonitor::MonitorSlavePort, SerialLink::SerialLinkSlavePort, LdsState::CuSidePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, TLBCoalescer::CpuSidePort, RubyPort::PioSlavePort, CoherentXBar::CoherentXBarSlavePort, NoncoherentXBar::NoncoherentXBarSlavePort, DRAMCtrl::MemoryPort, SimpleMemory::MemoryPort, RubyPort::MemSlavePort, StubSlavePort, DRAMSim2::MemoryPort, and SimpleTimingPort.
Referenced by MasterPort::sendFunctional().
|
protectedpure virtual |
Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to be called on the master port) and was unsuccesful.
Implemented in X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorSlavePort, Bridge::BridgeSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, SerialLink::SerialLinkSlavePort, LdsState::CuSidePort, TLBCoalescer::CpuSidePort, SimpleMemory::MemoryPort, StubSlavePort, DRAMSim2::MemoryPort, and QueuedSlavePort.
Referenced by MasterPort::sendRetryResp().
|
protectedpure virtual |
Receive a timing request from the master port.
Implemented in X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorSlavePort, Bridge::BridgeSlavePort, SerialLink::SerialLinkSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, TLBCoalescer::CpuSidePort, LdsState::CuSidePort, RubyPort::PioSlavePort, DRAMCtrl::MemoryPort, CoherentXBar::CoherentXBarSlavePort, NoncoherentXBar::NoncoherentXBarSlavePort, SimpleMemory::MemoryPort, RubyPort::MemSlavePort, StubSlavePort, DRAMSim2::MemoryPort, and SimpleTimingPort.
Referenced by MasterPort::sendTimingReq().
|
inlineprotectedvirtual |
Receive a timing snoop response from the master port.
Reimplemented in CommMonitor::MonitorSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, CoherentXBar::CoherentXBarSlavePort, and StubSlavePort.
Definition at line 457 of file port.hh.
References Port::name(), and panic.
Referenced by MasterPort::sendTimingSnoopResp().
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 237 of file port.cc.
References _masterPort, Packet::isRequest(), and MasterPort::recvAtomicSnoop().
Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvAtomicSnoop(), AddrMapper::recvAtomicSnoop(), and CommMonitor::recvAtomicSnoop().
void SlavePort::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.
pkt | Snoop packet to send. |
Definition at line 244 of file port.cc.
References _masterPort, Packet::isRequest(), and MasterPort::recvFunctionalSnoop().
Referenced by Cache::functionalAccess(), MemCheckerMonitor::recvFunctionalSnoop(), AddrMapper::recvFunctionalSnoop(), and CommMonitor::recvFunctionalSnoop().
|
inline |
Called by the owner to send a range change.
Definition at line 410 of file port.hh.
References _masterPort, fatal, Port::name(), and MasterPort::recvRangeChange().
Referenced by PioDevice::init(), ExternalSlave::init(), SimpleMemory::init(), DRAMSim2::init(), SerialLink::init(), Bridge::init(), BaseCache::init(), DRAMCtrl::init(), RubyPort::PioMasterPort::recvRangeChange(), MemCheckerMonitor::recvRangeChange(), AddrMapper::recvRangeChange(), CommMonitor::recvRangeChange(), PciDevice::unserialize(), Sinic::Device::unserialize(), and PciDevice::writeConfig().
void SlavePort::sendRetryReq | ( | ) |
Send a retry to the master port that previously attempted a sendTimingReq to this slave port and failed.
Definition at line 265 of file port.cc.
References _masterPort, and MasterPort::recvReqRetry().
Referenced by StubSlavePort::ResponseEvent::process(), DRAMCtrl::processNextReqEvent(), DRAMCtrl::processRespondEvent(), MemCheckerMonitor::recvReqRetry(), AddrMapper::recvReqRetry(), CommMonitor::recvReqRetry(), SimpleMemory::release(), BaseXBar::ReqLayer::sendRetry(), and DRAMSim2::tick().
void SlavePort::sendRetrySnoopResp | ( | ) |
Send a retry to the master port that previously attempted a sendTimingSnoopResp to this slave port and failed.
Definition at line 271 of file port.cc.
References _masterPort, and MasterPort::recvRetrySnoopResp().
Referenced by CommMonitor::recvRetrySnoopResp(), BaseXBar::SnoopRespLayer::sendRetry(), and CoherentXBar::SnoopRespPort::sendRetryResp().
bool SlavePort::sendTimingResp | ( | PacketPtr | pkt | ) |
Attempt to send a timing response to the master 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 251 of file port.cc.
References _masterPort, Packet::isResponse(), and MasterPort::recvTimingResp().
Referenced by SimpleMemory::dequeue(), StubSlavePort::ResponseEvent::process(), LdsState::process(), MemCheckerMonitor::recvTimingResp(), AddrMapper::recvTimingResp(), CommMonitor::recvTimingResp(), DRAMSim2::sendResponse(), RespPacketQueue::sendTiming(), and TLBCoalescer::updatePhysAddresses().
void SlavePort::sendTimingSnoopReq | ( | PacketPtr | pkt | ) |
Attempt to send a timing snoop request packet to the master 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 258 of file port.cc.
References _masterPort, Packet::isRequest(), and MasterPort::recvTimingSnoopReq().
Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvTimingSnoopReq(), AddrMapper::recvTimingSnoopReq(), CommMonitor::recvTimingSnoopReq(), and Cache::sendMSHRQueuePacket().
|
protected |
Called by the master port to unbind.
Should never be called directly.
Definition at line 223 of file port.cc.
References BaseSlavePort::_baseMasterPort, and _masterPort.
Referenced by MasterPort::unbind().
|
friend |
|
private |
Definition at line 338 of file port.hh.
Referenced by bind(), isSnooping(), sendAtomicSnoop(), sendFunctionalSnoop(), sendRangeChange(), sendRetryReq(), sendRetrySnoopResp(), sendTimingResp(), sendTimingSnoopReq(), and unbind().