gem5
v20.1.0.0
|
Ports are used to interface objects to each other. More...
#include <port.hh>
Classes | |
class | UnboundPortException |
Public Member Functions | |
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... | |
virtual void | bind (Port &peer) |
Attach to a peer port. More... | |
virtual void | unbind () |
Dettach from a peer port. 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 | reportUnbound () const |
Port (const std::string &_name, PortID _id) | |
Abstract base class for ports. More... | |
Protected Attributes | |
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 | |
const std::string | portName |
Descriptive name (for DPRINTF output) More... | |
|
protected |
|
virtual |
|
inlinevirtual |
Attach to a peer port.
Reimplemented in ResponsePort, TokenResponsePort, IntSourcePinBase, RequestPort, IntSinkPinBase, EtherInt, TokenRequestPort, and RubyDummyPort.
Definition at line 113 of file port.hh.
References _connected, and _peer.
Referenced by IntSinkPinBase::bind(), RequestPort::bind(), IntSourcePinBase::bind(), CxxConfigManager::bindPort(), ResponsePort::responderBind(), and takeOverFrom().
|
inline |
Get the port id.
Definition at line 109 of file port.hh.
References id.
Referenced by SnoopFilter::portToMask().
|
inline |
Return a reference to this port's peer.
Definition at line 103 of file port.hh.
References _peer.
Referenced by X86ISA::IntResponsePort< X86ISA::Interrupts >::recvAtomic(), SMMUv3DeviceInterface::recvAtomic(), SMMUv3DeviceInterface::recvTimingReq(), SMMUv3DeviceInterface::sendRange(), and takeOverFrom().
|
inline |
Is this port currently connected to a peer?
Definition at line 128 of file port.hh.
References _connected.
Referenced by CxxConfigManager::bindPort(), AddrMapper::init(), MemDelay::init(), MemCheckerMonitor::init(), CommMonitor::init(), ExternalMaster::init(), ExternalSlave::init(), PioDevice::init(), QoS::MemSinkCtrl::init(), SMMUv3::init(), SimpleMemory::init(), DRAMSim2::init(), DmaDevice::init(), DRAMsim3::init(), System::init(), BaseTrafficGen::init(), SerialLink::init(), Bridge::init(), MemCtrl::init(), BaseCache::init(), RubyPort::MemResponsePort::recvAtomic(), RubyPort::MemResponsePort::recvTimingReq(), SMMUv3DeviceInterface::sendRange(), takeOverFrom(), and RequestPort::unbind().
|
inline |
Return port name (for DPRINTF).
Definition at line 106 of file port.hh.
References portName.
Referenced by TokenRequestPort::acquireTokens(), IntSinkPinBase::bind(), RequestPort::bind(), IntSourcePinBase::bind(), TokenResponsePort::bind(), TokenRequestPort::haveTokens(), SnoopFilter::lookupRequest(), ReqPacketQueue::name(), SnoopRespPacketQueue::name(), RespPacketQueue::name(), operator<<(), X86ISA::IntResponsePort< X86ISA::Interrupts >::recvAtomic(), ResponsePort::recvAtomicBackdoor(), RequestPort::recvAtomicSnoop(), RequestPort::recvFunctionalSnoop(), RubyDirectedTester::CpuPort::recvReqRetry(), RubyTester::CpuPort::recvReqRetry(), RequestPort::recvRetrySnoopResp(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), RubyPort::MemRequestPort::recvTimingResp(), NoncoherentXBar::recvTimingResp(), CoherentXBar::recvTimingResp(), RequestPort::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopResp(), ResponsePort::recvTimingSnoopResp(), TokenRequestPort::recvTokens(), reportUnbound(), ResponsePort::tryTiming(), RequestPort::unbind(), SnoopFilter::updateResponse(), SnoopFilter::updateSnoopForward(), and SnoopFilter::updateSnoopResponse().
|
protected |
Definition at line 57 of file port.cc.
Referenced by RequestPort::sendAtomic(), RequestPort::sendAtomicBackdoor(), ResponsePort::sendAtomicSnoop(), RequestPort::sendFunctional(), ResponsePort::sendFunctionalSnoop(), ResponsePort::sendRetryReq(), RequestPort::sendRetryResp(), ResponsePort::sendRetrySnoopResp(), RequestPort::sendTimingReq(), ResponsePort::sendTimingResp(), ResponsePort::sendTimingSnoopReq(), RequestPort::sendTimingSnoopResp(), and RequestPort::tryTiming().
|
inline |
A utility function to make it easier to swap out ports.
Definition at line 132 of file port.hh.
References bind(), getPeer(), isConnected(), and unbind().
Referenced by TraceCPU::takeOverFrom(), and BaseCPU::takeOverFrom().
|
inlinevirtual |
Dettach from a peer port.
Reimplemented in ResponsePort, TokenResponsePort, IntSourcePinBase, RequestPort, IntSinkPinBase, TokenRequestPort, EtherInt, and RubyDummyPort.
Definition at line 121 of file port.hh.
References _connected, and _peer.
Referenced by ResponsePort::responderUnbind(), takeOverFrom(), IntSinkPinBase::unbind(), RequestPort::unbind(), and IntSourcePinBase::unbind().
|
protected |
Whether this port is currently connected to a peer port.
Definition at line 85 of file port.hh.
Referenced by EtherInt::bind(), bind(), isConnected(), EtherInt::unbind(), and unbind().
|
protected |
|
protected |
|
private |