gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SlavePort Class Referenceabstract

A SlavePort is a specialisation of a port. More...

#include <port.hh>

Inheritance diagram for SlavePort:
BaseSlavePort Port AddrMapper::MapperSlavePort Bridge::BridgeSlavePort CommMonitor::MonitorSlavePort DRAMSim2::MemoryPort ExternalSlave::Port LdsState::CuSidePort MemCheckerMonitor::MonitorSlavePort QueuedSlavePort SerialLink::SerialLinkSlavePort SimpleMemory::MemoryPort TLBCoalescer::CpuSidePort X86ISA::GpuTLB::CpuSidePort

Public Member Functions

 SlavePort (const std::string &name, MemObject *owner, PortID id=InvalidPortID)
 Slave port. More...
 
virtual ~SlavePort ()
 
Tick sendAtomicSnoop (PacketPtr pkt)
 Send an atomic snoop request packet, where the data is moved and the state is updated in zero time, without interleaving with other memory accesses. More...
 
void sendFunctionalSnoop (PacketPtr pkt)
 Send a functional snoop request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block. More...
 
bool sendTimingResp (PacketPtr pkt)
 Attempt to send a timing response to the master port by calling its corresponding receive function. More...
 
void sendTimingSnoopReq (PacketPtr pkt)
 Attempt to send a timing snoop request packet to the master port by calling its corresponding receive function. More...
 
void sendRetryReq ()
 Send a retry to the master port that previously attempted a sendTimingReq to this slave port and failed. More...
 
void sendRetrySnoopResp ()
 Send a retry to the master port that previously attempted a sendTimingSnoopResp to this slave port and failed. More...
 
bool isSnooping () const
 Find out if the peer master port is snooping or not. More...
 
void sendRangeChange () const
 Called by the owner to send a range change. More...
 
virtual AddrRangeList getAddrRanges () const =0
 Get a list of the non-overlapping address ranges the owner is responsible for. More...
 
- Public Member Functions inherited from BaseSlavePort
BaseMasterPortgetMasterPort () const
 
bool isConnected () const
 
- Public Member Functions inherited from Port
const std::string name () const
 Return port name (for DPRINTF). More...
 
PortID getId () const
 Get the port id. More...
 

Protected Member Functions

void unbind ()
 Called by the master port to unbind. More...
 
void bind (MasterPort &master_port)
 Called by the master port to bind. More...
 
virtual Tick recvAtomic (PacketPtr pkt)=0
 Receive an atomic request packet from the master port. More...
 
virtual void recvFunctional (PacketPtr pkt)=0
 Receive a functional request packet from the master port. More...
 
virtual bool recvTimingReq (PacketPtr pkt)=0
 Receive a timing request from the master port. More...
 
virtual bool recvTimingSnoopResp (PacketPtr pkt)
 Receive a timing snoop response from the master port. More...
 
virtual void recvRespRetry ()=0
 Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to be called on the master port) and was unsuccesful. More...
 
- Protected Member Functions inherited from BaseSlavePort
 BaseSlavePort (const std::string &name, MemObject *owner, PortID id=InvalidPortID)
 
virtual ~BaseSlavePort ()
 
- Protected Member Functions inherited from Port
 Port (const std::string &_name, MemObject &_owner, PortID _id)
 Abstract base class for ports. More...
 
virtual ~Port ()
 Virtual destructor due to inheritance. More...
 

Private Attributes

MasterPort_masterPort
 

Friends

class MasterPort
 

Additional Inherited Members

- Protected Attributes inherited from BaseSlavePort
BaseMasterPort_baseMasterPort
 
- Protected Attributes inherited from Port
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...
 
MemObjectowner
 A reference to the MemObject that owns this port. More...
 

Detailed Description

A SlavePort is a specialisation of a port.

In addition to the basic functionality of sending packets to its master peer, it also has functions specific to a slave, e.g. to send range changes and get the address ranges that the port responds to.

Definition at line 331 of file port.hh.

Constructor & Destructor Documentation

SlavePort::SlavePort ( const std::string &  name,
MemObject owner,
PortID  id = InvalidPortID 
)

Slave port.

Definition at line 213 of file port.cc.

SlavePort::~SlavePort ( )
virtual

Definition at line 218 of file port.cc.

Member Function Documentation

void SlavePort::bind ( MasterPort master_port)
protected

Called by the master port to bind.

Should never be called directly.

Definition at line 230 of file port.cc.

References BaseSlavePort::_baseMasterPort, and _masterPort.

Referenced by MasterPort::bind().

virtual AddrRangeList SlavePort::getAddrRanges ( ) const
pure virtual
bool SlavePort::isSnooping ( ) const
inline
virtual Tick SlavePort::recvAtomic ( PacketPtr  pkt)
protectedpure virtual
virtual void SlavePort::recvFunctional ( PacketPtr  pkt)
protectedpure virtual
virtual void SlavePort::recvRespRetry ( )
protectedpure virtual

Called by the master port if sendTimingResp was called on this slave port (causing recvTimingResp to be called on the master port) and was unsuccesful.

Implemented in X86ISA::GpuTLB::CpuSidePort, CommMonitor::MonitorSlavePort, Bridge::BridgeSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, SerialLink::SerialLinkSlavePort, LdsState::CuSidePort, TLBCoalescer::CpuSidePort, SimpleMemory::MemoryPort, StubSlavePort, DRAMSim2::MemoryPort, and QueuedSlavePort.

Referenced by MasterPort::sendRetryResp().

virtual bool SlavePort::recvTimingReq ( PacketPtr  pkt)
protectedpure virtual
virtual bool SlavePort::recvTimingSnoopResp ( PacketPtr  pkt)
inlineprotectedvirtual

Receive a timing snoop response from the master port.

Reimplemented in CommMonitor::MonitorSlavePort, AddrMapper::MapperSlavePort, MemCheckerMonitor::MonitorSlavePort, CoherentXBar::CoherentXBarSlavePort, and StubSlavePort.

Definition at line 457 of file port.hh.

References Port::name(), and panic.

Referenced by MasterPort::sendTimingSnoopResp().

Tick SlavePort::sendAtomicSnoop ( PacketPtr  pkt)

Send an atomic snoop request packet, where the data is moved and the state is updated in zero time, without interleaving with other memory accesses.

Parameters
pktSnoop packet to send.
Returns
Estimated latency of access.

Definition at line 237 of file port.cc.

References _masterPort, Packet::isRequest(), and MasterPort::recvAtomicSnoop().

Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvAtomicSnoop(), AddrMapper::recvAtomicSnoop(), and CommMonitor::recvAtomicSnoop().

void SlavePort::sendFunctionalSnoop ( PacketPtr  pkt)

Send a functional snoop request packet, where the data is instantly updated everywhere in the memory system, without affecting the current state of any block or moving the block.

Parameters
pktSnoop packet to send.

Definition at line 244 of file port.cc.

References _masterPort, Packet::isRequest(), and MasterPort::recvFunctionalSnoop().

Referenced by Cache::functionalAccess(), MemCheckerMonitor::recvFunctionalSnoop(), AddrMapper::recvFunctionalSnoop(), and CommMonitor::recvFunctionalSnoop().

void SlavePort::sendRangeChange ( ) const
inline
void SlavePort::sendRetryReq ( )
void SlavePort::sendRetrySnoopResp ( )

Send a retry to the master port that previously attempted a sendTimingSnoopResp to this slave port and failed.

Definition at line 271 of file port.cc.

References _masterPort, and MasterPort::recvRetrySnoopResp().

Referenced by CommMonitor::recvRetrySnoopResp(), BaseXBar::SnoopRespLayer::sendRetry(), and CoherentXBar::SnoopRespPort::sendRetryResp().

bool SlavePort::sendTimingResp ( PacketPtr  pkt)

Attempt to send a timing response to the master port by calling its corresponding receive function.

If the send does not succeed, as indicated by the return value, then the sender must wait for a recvRespRetry at which point it can re-issue a sendTimingResp.

Parameters
pktPacket to send.
Returns
If the send was succesful or not.

Definition at line 251 of file port.cc.

References _masterPort, Packet::isResponse(), and MasterPort::recvTimingResp().

Referenced by SimpleMemory::dequeue(), StubSlavePort::ResponseEvent::process(), LdsState::process(), MemCheckerMonitor::recvTimingResp(), AddrMapper::recvTimingResp(), CommMonitor::recvTimingResp(), DRAMSim2::sendResponse(), RespPacketQueue::sendTiming(), and TLBCoalescer::updatePhysAddresses().

void SlavePort::sendTimingSnoopReq ( PacketPtr  pkt)

Attempt to send a timing snoop request packet to the master port by calling its corresponding receive function.

Snoop requests always succeed and hence no return value is needed.

Parameters
pktPacket to send.

Definition at line 258 of file port.cc.

References _masterPort, Packet::isRequest(), and MasterPort::recvTimingSnoopReq().

Referenced by Cache::handleSnoop(), Cache::isCachedAbove(), MemCheckerMonitor::recvTimingSnoopReq(), AddrMapper::recvTimingSnoopReq(), CommMonitor::recvTimingSnoopReq(), and Cache::sendMSHRQueuePacket().

void SlavePort::unbind ( )
protected

Called by the master port to unbind.

Should never be called directly.

Definition at line 223 of file port.cc.

References BaseSlavePort::_baseMasterPort, and _masterPort.

Referenced by MasterPort::unbind().

Friends And Related Function Documentation

friend class MasterPort
friend

Definition at line 334 of file port.hh.

Member Data Documentation

MasterPort* SlavePort::_masterPort
private

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

Generated on Fri Jun 9 2017 13:04:19 for gem5 by doxygen 1.8.6