gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Port Class Reference

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

#include <port.hh>

Inheritance diagram for Port:
EtherInt IntSinkPinBase IntSourcePinBase MasterPort 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 > SlavePort 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 >

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

 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 56 of file port.hh.

Constructor & Destructor Documentation

◆ Port()

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 48 of file port.cc.

◆ ~Port()

Port::~Port ( )
virtual

Virtual destructor due to inheritance.

Definition at line 51 of file port.cc.

Member Function Documentation

◆ bind()

virtual void Port::bind ( Port peer)
inlinevirtual

◆ getId()

PortID Port::getId ( ) const
inline

Get the port id.

Definition at line 105 of file port.hh.

References id.

Referenced by SnoopFilter::portToMask().

◆ getPeer()

Port& Port::getPeer ( )
inline

◆ isConnected()

bool Port::isConnected ( ) const
inline

◆ name()

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

◆ takeOverFrom()

void Port::takeOverFrom ( Port old)
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().

◆ unbind()

virtual void Port::unbind ( )
inlinevirtual

Member Data Documentation

◆ _connected

bool Port::_connected
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().

◆ _peer

Port* Port::_peer
protected

A pointer to this port's peer.

Definition at line 75 of file port.hh.

Referenced by getPeer().

◆ id

const PortID 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 70 of file port.hh.

Referenced by getId(), and RubyPort::MemSlavePort::recvTimingReq().

◆ portName

const std::string Port::portName
private

Descriptive name (for DPRINTF output)

Definition at line 62 of file port.hh.

Referenced by name().


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

Generated on Thu May 28 2020 16:21:49 for gem5 by doxygen 1.8.13