gem5
v20.0.0.3
|
Ports are used to interface objects to each other. More...
#include <port.hh>
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 | |
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 SlavePort, TokenSlavePort, IntSourcePinBase, MasterPort, IntSinkPinBase, EtherInt, TokenMasterPort, and RubyDummyPort.
Definition at line 109 of file port.hh.
Referenced by IntSinkPinBase::bind(), MasterPort::bind(), IntSourcePinBase::bind(), CxxConfigManager::bindPort(), SlavePort::slaveBind(), and takeOverFrom().
|
inline |
Get the port id.
Definition at line 105 of file port.hh.
References id.
Referenced by SnoopFilter::portToMask().
|
inline |
Return a reference to this port's peer.
Definition at line 99 of file port.hh.
References _peer.
Referenced by X86ISA::IntSlavePort< X86ISA::Interrupts >::recvAtomic(), SMMUv3SlaveInterface::recvAtomic(), SMMUv3SlaveInterface::recvTimingReq(), SMMUv3SlaveInterface::sendRange(), and takeOverFrom().
|
inline |
Is this port currently connected to a peer?
Definition at line 124 of file port.hh.
References _connected.
Referenced by CxxConfigManager::bindPort(), AddrMapper::init(), MemDelay::init(), MemCheckerMonitor::init(), CommMonitor::init(), System::init(), ExternalMaster::init(), ExternalSlave::init(), PioDevice::init(), QoS::MemSinkCtrl::init(), SMMUv3::init(), SimpleMemory::init(), DRAMSim2::init(), DmaDevice::init(), BaseTrafficGen::init(), SerialLink::init(), Bridge::init(), BaseCache::init(), DRAMCtrl::init(), RubyPort::MemSlavePort::recvAtomic(), SMMUv3SlaveInterface::sendRange(), and takeOverFrom().
|
inline |
Return port name (for DPRINTF).
Definition at line 102 of file port.hh.
References portName.
Referenced by TokenMasterPort::acquireTokens(), EtherInt::bind(), sc_gem5::TlmInitiatorBaseWrapper< BITWIDTH >::bind(), IntSinkPinBase::bind(), sc_gem5::ScPortWrapper< IF >::bind(), MasterPort::bind(), IntSourcePinBase::bind(), TokenSlavePort::bind(), sc_gem5::ScInterfaceWrapper< IF >::bind(), sc_gem5::ScExportWrapper< IF >::bind(), DmaCallback::getChunkEvent(), StubSlavePortHandler::getExternalPort(), TokenMasterPort::haveTokens(), SnoopFilter::lookupRequest(), ReqPacketQueue::name(), SnoopRespPacketQueue::name(), RespPacketQueue::name(), operator<<(), X86ISA::IntSlavePort< X86ISA::Interrupts >::recvAtomic(), SlavePort::recvAtomicBackdoor(), MasterPort::recvAtomicSnoop(), MasterPort::recvFunctionalSnoop(), RubyDirectedTester::CpuPort::recvReqRetry(), RubyTester::CpuPort::recvReqRetry(), MasterPort::recvRetrySnoopResp(), HMCController::recvTimingReq(), NoncoherentXBar::recvTimingReq(), CoherentXBar::recvTimingReq(), NoncoherentXBar::recvTimingResp(), CoherentXBar::recvTimingResp(), MasterPort::recvTimingSnoopReq(), CoherentXBar::recvTimingSnoopResp(), SlavePort::recvTimingSnoopResp(), TokenMasterPort::recvTokens(), SlavePort::sendRangeChange(), StubSlavePort::StubSlavePort(), SlavePort::tryTiming(), MasterPort::unbind(), SnoopFilter::updateResponse(), SnoopFilter::updateSnoopForward(), SnoopFilter::updateSnoopResponse(), RiscvISA::Walker::Walker(), and X86ISA::Walker::Walker().
|
inline |
A utility function to make it easier to swap out ports.
Definition at line 128 of file port.hh.
References bind(), getPeer(), isConnected(), and unbind().
Referenced by AtomicSimpleCPU::getInstPort(), TraceCPU::takeOverFrom(), and BaseCPU::takeOverFrom().
|
inlinevirtual |
Dettach from a peer port.
Reimplemented in SlavePort, sc_gem5::ScExportWrapper< IF >, TokenSlavePort, sc_gem5::ScInterfaceWrapper< IF >, sc_gem5::TlmTargetBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL >, sc_gem5::TlmTargetBaseWrapper< 64 >, sc_gem5::TlmTargetBaseWrapper< 64, amba_pv::amba_pv_protocol_types >, sc_gem5::TlmTargetBaseWrapper< BITWIDTH >, IntSourcePinBase, MasterPort, sc_gem5::TlmInitiatorBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL >, sc_gem5::TlmInitiatorBaseWrapper< 64 >, sc_gem5::TlmInitiatorBaseWrapper< 64, amba_pv::amba_pv_protocol_types >, sc_gem5::TlmInitiatorBaseWrapper< BITWIDTH >, IntSinkPinBase, sc_gem5::ScPortWrapper< IF >, TokenMasterPort, EtherInt, and RubyDummyPort.
Definition at line 117 of file port.hh.
Referenced by SlavePort::slaveUnbind(), takeOverFrom(), IntSinkPinBase::unbind(), MasterPort::unbind(), and IntSourcePinBase::unbind().
|
protected |
Whether this port is currently connected to a peer port.
Definition at line 81 of file port.hh.
Referenced by EtherInt::bind(), isConnected(), and EtherInt::unbind().
|
protected |
|
protected |
A numeric identifier to distinguish ports in a vector, and set to InvalidPortID in case this port is not part of a vector.
Definition at line 70 of file port.hh.
Referenced by getId(), and RubyPort::MemSlavePort::recvTimingReq().
|
private |