gem5  v21.1.0.2
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::ResponsePort gem5::ruby::RubyDummyPort TestPort gem5::DistEtherLink::LocalIface gem5::EtherLink::Interface gem5::EtherSwitch::Interface gem5::EtherTapInt gem5::IGbEInt gem5::NSGigEInt gem5::sinic::Interface gem5::IntSinkPin< Device > gem5::IntSinkPin< gem5::Clint > gem5::IntSinkPin< gem5::X86ISA::I82094AA > gem5::IntSinkPin< gem5::X86ISA::I8259 > gem5::IntSourcePin< Device > gem5::IntSourcePin< gem5::X86ISA::Cmos::X86RTC > gem5::IntSourcePin< gem5::X86ISA::I8042 > gem5::IntSourcePin< gem5::X86ISA::I8254 > gem5::IntSourcePin< gem5::X86ISA::I8259 > gem5::AddrMapper::MapperRequestPort gem5::AtomicSimpleCPU::AtomicCPUPort gem5::BaseKvmCPU::KVMCpuPort gem5::BaseTrafficGen::TrafficGenPort gem5::Bridge::BridgeRequestPort gem5::CoherentXBar::CoherentXBarRequestPort gem5::CoherentXBar::SnoopRespPort gem5::CommMonitor::MonitorRequestPort gem5::ComputeUnit::DataPort gem5::ComputeUnit::DTLBPort gem5::ComputeUnit::ITLBPort gem5::ComputeUnit::LDSPort gem5::ComputeUnit::ScalarDataPort gem5::ComputeUnit::ScalarDTLBPort gem5::ComputeUnit::SQCPort gem5::DmaPort gem5::ExternalMaster::ExternalPort gem5::GarnetSyntheticTraffic::CpuPort gem5::Gicv3Its::DataPort gem5::MasterPort gem5::MemCheckerMonitor::MonitorRequestPort gem5::MemTest::CpuPort gem5::MinorCPU::MinorCPUPort gem5::NoncoherentXBar::NoncoherentXBarRequestPort gem5::o3::Fetch::IcachePort gem5::o3::LSQ::DcachePort gem5::ProtocolTester::SeqPort gem5::QueuedRequestPort gem5::RiscvISA::Walker::WalkerPort gem5::ruby::AbstractController::MemoryPort gem5::RubyDirectedTester::CpuPort gem5::RubyTester::CpuPort gem5::SerialLink::SerialLinkRequestPort gem5::SimpleCache::MemSidePort gem5::SimpleMemobj::MemSidePort gem5::SMMURequestPort gem5::SMMUTableWalkPort gem5::System::SystemPort gem5::TimingSimpleCPU::TimingCPUPort gem5::TLBCoalescer::MemSidePort gem5::TokenRequestPort gem5::TraceCPU::DcachePort gem5::TraceCPU::IcachePort gem5::X86ISA::GpuTLB::MemSidePort gem5::X86ISA::Walker::WalkerPort sc_gem5::TlmToGem5Bridge< BITWIDTH >::BridgeRequestPort gem5::AddrMapper::MapperResponsePort gem5::Bridge::BridgeResponsePort gem5::CommMonitor::MonitorResponsePort gem5::LdsState::CuSidePort gem5::MemCheckerMonitor::MonitorResponsePort gem5::memory::CfiMemory::MemoryPort gem5::memory::DRAMSim2::MemoryPort gem5::memory::DRAMsim3::MemoryPort gem5::memory::SimpleMemory::MemoryPort gem5::QueuedResponsePort gem5::SerialLink::SerialLinkResponsePort gem5::SimpleCache::CPUSidePort gem5::SimpleMemobj::CPUSidePort gem5::SlavePort gem5::TLBCoalescer::CpuSidePort gem5::TokenResponsePort gem5::X86ISA::GpuTLB::CpuSidePort sc_gem5::Gem5ToTlmBridge< BITWIDTH >::BridgeResponsePort

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::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(), 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::BaseMMU::takeOverFrom(), gem5::TraceCPU::takeOverFrom(), gem5::BaseCPU::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 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 Sep 21 2021 12:27:58 for gem5 by doxygen 1.8.17