gem5  v22.1.0.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
gem5::Port Class Reference

Ports are used to interface objects to each other. More...

#include <port.hh>

Inheritance diagram for gem5::Port:
sc_gem5::TlmInitiatorBaseWrapper< 64 > sc_gem5::TlmInitiatorBaseWrapper< 64, amba_pv::amba_pv_protocol_types > sc_gem5::TlmInitiatorBaseWrapper< BITWIDTH > sc_gem5::TlmTargetBaseWrapper< 64 > sc_gem5::TlmTargetBaseWrapper< 64, amba_pv::amba_pv_protocol_types > sc_gem5::TlmTargetBaseWrapper< BITWIDTH > TestPort gem5::EtherInt gem5::IntSinkPinBase gem5::IntSourcePinBase gem5::RequestPort gem5::ResetRequestPort gem5::ResetResponsePortBase gem5::ResponsePort gem5::ruby::RubyDummyPort sc_gem5::ScExportWrapper< IF > sc_gem5::ScInterfaceWrapper< IF > sc_gem5::ScPortWrapper< IF > sc_gem5::TlmInitiatorBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL > sc_gem5::TlmTargetBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL >

Classes

class  UnboundPortException
 

Public Member Functions

virtual ~Port ()
 Virtual destructor due to inheritance. More...
 
PortgetPeer ()
 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...
 

Detailed Description

Ports are used to interface objects to each other.

Definition at line 61 of file port.hh.

Constructor & Destructor Documentation

◆ Port()

gem5::Port::Port ( const std::string &  _name,
PortID  _id 
)
protected

Abstract base class for ports.

Parameters
_namePort name including the owners name
_idA port identifier for vector ports

Definition at line 53 of file port.cc.

◆ ~Port()

gem5::Port::~Port ( )
virtual

Virtual destructor due to inheritance.

Definition at line 56 of file port.cc.

Member Function Documentation

◆ bind()

virtual void gem5::Port::bind ( Port peer)
inlinevirtual

◆ getId()

PortID gem5::Port::getId ( ) const
inline

Get the port id.

Definition at line 114 of file port.hh.

References id.

Referenced by gem5::SnoopFilter::portToMask(), and TEST().

◆ getPeer()

Port& gem5::Port::getPeer ( )
inline

◆ isConnected()

bool gem5::Port::isConnected ( ) const
inline

◆ name()

const std::string gem5::Port::name ( ) const
inline

Return port name (for DPRINTF).

Definition at line 111 of file port.hh.

References portName.

Referenced by gem5::TokenRequestPort::acquireTokens(), sc_gem5::ScPortWrapper< IF >::bind(), sc_gem5::ScInterfaceWrapper< IF >::bind(), sc_gem5::ScExportWrapper< IF >::bind(), sc_gem5::TlmInitiatorBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL >::bind(), gem5::ResetRequestPort::bind(), gem5::IntSinkPinBase::bind(), gem5::IntSourcePinBase::bind(), gem5::RequestPort::bind(), gem5::TokenResponsePort::bind(), gem5::TokenRequestPort::haveTokens(), gem5::SnoopFilter::lookupRequest(), gem5::ReqPacketQueue::name(), gem5::SnoopRespPacketQueue::name(), gem5::RespPacketQueue::name(), gem5::operator<<(), gem5::X86ISA::IntResponsePort< Device >::recvAtomic(), gem5::ResponsePort::recvAtomicBackdoor(), gem5::RequestPort::recvAtomicSnoop(), gem5::RequestPort::recvFunctionalSnoop(), gem5::RubyDirectedTester::CpuPort::recvReqRetry(), gem5::ProtocolTester::SeqPort::recvReqRetry(), gem5::RubyTester::CpuPort::recvReqRetry(), gem5::RequestPort::recvRetrySnoopResp(), gem5::CoherentXBar::recvTimingReq(), gem5::HMCController::recvTimingReq(), gem5::NoncoherentXBar::recvTimingReq(), gem5::ruby::RubyPort::MemRequestPort::recvTimingResp(), gem5::CoherentXBar::recvTimingResp(), gem5::NoncoherentXBar::recvTimingResp(), gem5::RequestPort::recvTimingSnoopReq(), gem5::ResponsePort::recvTimingSnoopResp(), gem5::CoherentXBar::recvTimingSnoopResp(), gem5::TokenRequestPort::recvTokens(), gem5::fastmodel::ResetControllerExample::Registers::Registers(), reportUnbound(), gem5::ResponsePort::tryTiming(), gem5::RequestPort::unbind(), gem5::SnoopFilter::updateResponse(), gem5::SnoopFilter::updateSnoopForward(), and gem5::SnoopFilter::updateSnoopResponse().

◆ reportUnbound()

void gem5::Port::reportUnbound ( ) const
protected

◆ takeOverFrom()

void gem5::Port::takeOverFrom ( Port old)
inline

A utility function to make it easier to swap out ports.

Definition at line 137 of file port.hh.

References bind(), getPeer(), isConnected(), and unbind().

Referenced by gem5::BaseCPU::takeOverFrom(), gem5::TraceCPU::takeOverFrom(), gem5::BaseMMU::takeOverFrom(), and TEST().

◆ unbind()

virtual void gem5::Port::unbind ( )
inlinevirtual

Member Data Documentation

◆ _connected

bool gem5::Port::_connected
protected

Whether this port is currently connected to a peer port.

Definition at line 90 of file port.hh.

Referenced by bind(), gem5::EtherInt::bind(), isConnected(), unbind(), and gem5::EtherInt::unbind().

◆ _peer

Port* gem5::Port::_peer
protected

A pointer to this port's peer.

Definition at line 84 of file port.hh.

Referenced by bind(), getPeer(), and unbind().

◆ id

const PortID gem5::Port::id
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 79 of file port.hh.

Referenced by getId().

◆ portName

const std::string gem5::Port::portName
private

Descriptive name (for DPRINTF output)

Definition at line 67 of file port.hh.

Referenced by name().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:23:30 for gem5 by doxygen 1.9.1