gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::Port Class Reference

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

#include <port.hh>

Inheritance diagram for gem5::Port:
gem5::SignalSinkPort< bool > gem5::SignalSourcePort< bool > sc_gem5::TlmInitiatorBaseWrapper< 64, amba_pv::amba_pv_protocol_types > sc_gem5::TlmInitiatorBaseWrapper< 64 > 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::RequestPort gem5::ResponsePort gem5::SignalSinkPort< State > gem5::SignalSourcePort< State > 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.
 
PortgetPeer ()
 Return a reference to this port's peer.
 
const std::string name () const
 Return port name (for DPRINTF).
 
PortID getId () const
 Get the port id.
 
virtual void bind (Port &peer)
 Attach to a peer port.
 
virtual void unbind ()
 Dettach from a peer port.
 
bool isConnected () const
 Is this port currently connected to a peer?
 
void takeOverFrom (Port *old)
 A utility function to make it easier to swap out ports.
 

Protected Member Functions

void reportUnbound () const
 
 Port (const std::string &_name, PortID _id)
 Abstract base class for ports.
 

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.
 
Port_peer
 A pointer to this port's peer.
 
bool _connected
 Whether this port is currently connected to a peer port.
 

Private Attributes

const std::string portName
 Descriptive name (for DPRINTF output)
 

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

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

◆ 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(), gem5::RequestPort::addTrace(), gem5::SignalSinkPort< State >::bind(), gem5::SignalSourcePort< State >::bind(), gem5::TokenResponsePort::bind(), sc_gem5::ScExportWrapper< IF >::bind(), sc_gem5::ScInterfaceWrapper< IF >::bind(), sc_gem5::ScPortWrapper< IF >::bind(), sc_gem5::TlmInitiatorBaseWrapper< BUSWIDTH, FW_IF, BW_IF, N, POL >::bind(), gem5::TokenRequestPort::haveTokens(), gem5::SnoopFilter::lookupRequest(), gem5::ReqPacketQueue::name(), gem5::RespPacketQueue::name(), gem5::SnoopRespPacketQueue::name(), gem5::operator<<(), gem5::X86ISA::IntResponsePort< Device >::recvAtomic(), gem5::ResponsePort::recvAtomicBackdoor(), gem5::RequestPort::recvAtomicSnoop(), gem5::RequestPort::recvFunctionalSnoop(), gem5::ResponsePort::recvMemBackdoorReq(), gem5::ProtocolTester::SeqPort::recvReqRetry(), gem5::RubyDirectedTester::CpuPort::recvReqRetry(), gem5::RubyTester::CpuPort::recvReqRetry(), gem5::RequestPort::recvRetrySnoopResp(), gem5::CoherentXBar::recvTimingReq(), gem5::HMCController::recvTimingReq(), gem5::NoncoherentXBar::recvTimingReq(), gem5::CoherentXBar::recvTimingResp(), gem5::NoncoherentXBar::recvTimingResp(), gem5::ruby::RubyPort::MemRequestPort::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()

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

◆ unbind()

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 gem5::EtherInt::bind(), bind(), isConnected(), gem5::EtherInt::unbind(), and 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 Tue Jun 18 2024 16:24:13 for gem5 by doxygen 1.11.0