gem5  v22.0.0.1
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:
gem5::EtherInt gem5::IntSinkPinBase gem5::IntSourcePinBase gem5::RequestPort gem5::ResetRequestPort gem5::ResetResponsePortBase gem5::ResponsePort gem5::ruby::RubyDummyPort TestPort


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...
 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 

Abstract base class for ports.

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

Definition at line 53 of file

◆ ~Port()

gem5::Port::~Port ( )

Virtual destructor due to inheritance.

Definition at line 56 of file

Member Function Documentation

◆ bind()

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

◆ getId()

PortID gem5::Port::getId ( ) const

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 ( )

◆ isConnected()

bool gem5::Port::isConnected ( ) const

◆ name()

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

Return port name (for DPRINTF).

Definition at line 111 of file port.hh.

References portName.

Referenced by gem5::TokenRequestPort::acquireTokens(), gem5::ResetRequestPort::bind(), sc_gem5::TlmInitiatorBaseWrapper< BITWIDTH >::bind(), gem5::IntSinkPinBase::bind(), sc_gem5::ScPortWrapper< IF >::bind(), gem5::RequestPort::bind(), gem5::IntSourcePinBase::bind(), gem5::TokenResponsePort::bind(), sc_gem5::ScInterfaceWrapper< IF >::bind(), sc_gem5::ScExportWrapper< IF >::bind(), gem5::TokenRequestPort::haveTokens(), gem5::SnoopFilter::lookupRequest(), gem5::ReqPacketQueue::name(), gem5::SnoopRespPacketQueue::name(), gem5::RespPacketQueue::name(), gem5::operator<<(), gem5::X86ISA::IntResponsePort< gem5::X86ISA::Interrupts >::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::HMCController::recvTimingReq(), gem5::NoncoherentXBar::recvTimingReq(), gem5::CoherentXBar::recvTimingReq(), gem5::ruby::RubyPort::MemRequestPort::recvTimingResp(), gem5::NoncoherentXBar::recvTimingResp(), gem5::CoherentXBar::recvTimingResp(), gem5::RequestPort::recvTimingSnoopReq(), gem5::CoherentXBar::recvTimingSnoopResp(), gem5::ResponsePort::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

◆ takeOverFrom()

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

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::BaseMMU::takeOverFrom(), gem5::TraceCPU::takeOverFrom(), and TEST().

◆ unbind()

virtual void gem5::Port::unbind ( )

Member Data Documentation

◆ _connected

bool gem5::Port::_connected

Whether this port is currently connected to a peer port.

Definition at line 90 of file port.hh.

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

◆ _peer

Port* gem5::Port::_peer

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

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

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 Sat Jun 18 2022 08:13:20 for gem5 by doxygen 1.8.17