gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::SignalSinkPort< State > Class Template Reference

#include <signal.hh>

Inheritance diagram for gem5::SignalSinkPort< State >:
gem5::Port

Public Types

using OnChangeFunc = std::function<void(const State &new_val)>
 

Public Member Functions

 SignalSinkPort (const std::string &_name, PortID _id=InvalidPortID)
 
const State & state () const
 
void onChange (OnChangeFunc func)
 
void bind (Port &peer) override
 Attach to a peer port.
 
void unbind () override
 Dettach from a peer port.
 
- Public Member Functions inherited from gem5::Port
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.
 
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 set (const State &new_state, const bool bypass_on_change=false)
 
- Protected Member Functions inherited from gem5::Port
void reportUnbound () const
 
 Port (const std::string &_name, PortID _id)
 Abstract base class for ports.
 

Private Attributes

friend SignalSourcePort< State >
 
SignalSourcePort< State > * _source = nullptr
 
State _state = {}
 
OnChangeFunc _onChange
 

Additional Inherited Members

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

Detailed Description

template<typename State>
class gem5::SignalSinkPort< State >

Definition at line 43 of file signal.hh.

Member Typedef Documentation

◆ OnChangeFunc

template<typename State >
using gem5::SignalSinkPort< State >::OnChangeFunc = std::function<void(const State &new_val)>

Definition at line 46 of file signal.hh.

Constructor & Destructor Documentation

◆ SignalSinkPort()

template<typename State >
gem5::SignalSinkPort< State >::SignalSinkPort ( const std::string & _name,
PortID _id = InvalidPortID )
inline

Definition at line 71 of file signal.hh.

Member Function Documentation

◆ bind()

template<typename State >
void gem5::SignalSinkPort< State >::bind ( Port & peer)
inlineoverridevirtual

Attach to a peer port.

Reimplemented from gem5::Port.

Definition at line 79 of file signal.hh.

References gem5::SignalSinkPort< State >::_source, gem5::SignalSinkPort< State >::_state, gem5::Port::bind(), fatal_if, and gem5::Port::name().

◆ onChange()

◆ set()

template<typename State >
void gem5::SignalSinkPort< State >::set ( const State & new_state,
const bool bypass_on_change = false )
inlineprotected

◆ state()

template<typename State >
const State & gem5::SignalSinkPort< State >::state ( ) const
inline

Definition at line 75 of file signal.hh.

References gem5::SignalSinkPort< State >::_state.

Referenced by gem5::BaseCPU::activateContext().

◆ unbind()

template<typename State >
void gem5::SignalSinkPort< State >::unbind ( )
inlineoverridevirtual

Dettach from a peer port.

Reimplemented from gem5::Port.

Definition at line 89 of file signal.hh.

References gem5::SignalSinkPort< State >::_source, and gem5::Port::unbind().

Member Data Documentation

◆ _onChange

template<typename State >
OnChangeFunc gem5::SignalSinkPort< State >::_onChange
private

◆ _source

template<typename State >
SignalSourcePort<State>* gem5::SignalSinkPort< State >::_source = nullptr
private

◆ _state

template<typename State >
State gem5::SignalSinkPort< State >::_state = {}
private

◆ SignalSourcePort< State >

template<typename State >
friend gem5::SignalSinkPort< State >::SignalSourcePort< State >
private

Definition at line 49 of file signal.hh.


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

Generated on Tue Jun 18 2024 16:24:14 for gem5 by doxygen 1.11.0