Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Types | Public Member Functions | List of all members
sr_signal::signal_infield< TYPE, MODULE > Class Template Reference

#include <sr_signal_infield.h>

Inheritance diagram for sr_signal::signal_infield< TYPE, MODULE >:
Collaboration diagram for sr_signal::signal_infield< TYPE, MODULE >:

Public Types

typedef void(MODULE::* t_callback )(const TYPE &value, const uint32_t &channel, const sc_core::sc_time &time)
 

Public Member Functions

 signal_infield (sc_core::sc_module_name mn=NULL)
 
 signal_infield (t_callback callback, sc_core::sc_module_name mn=NULL)
 
virtual ~signal_infield ()
 Virtual destructor. More...
 
virtual void bind (signal_out_bind_if< TYPE > &sender, const uint32_t &channel=0)
 
virtual void update (signal_out_if< TYPE > *sender, const sc_core::sc_time &time)
 
TYPE read (const uint32_t &channel) const
 
TYPE read (const uint32_t &channel, const TYPE &default_value) const
 
TYPE operator[] (const uint32_t &channel) const
 Gets the value of a specific channel. More...
 
void operator() (signal_out_bind_if< TYPE > &sender, uint32_t channel)
 Connect the infield with an output on a specific channel. More...
 
- Public Member Functions inherited from sr_signal::signal_base< TYPE, MODULE >
 signal_base (sc_core::sc_module_name mn=NULL)
 Default constructor. More...
 
virtual ~signal_base ()
 
- Public Member Functions inherited from sr_signal::signal_in_if< TYPE >
virtual ~signal_in_if ()
 Virtual destructor. More...
 
- Public Member Functions inherited from sr_signal::signal_if< TYPE >
virtual ~signal_if ()
 Virtual destructor. More...
 
virtual const TYPE & read ()
 Read the current signal value. More...
 
 operator TYPE () const
 Call operator to get the current signal value. More...
 
bool operator== (const TYPE &t) const
 Comparing the current signal value with a variable of the same type TYPE. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sr_signal::signal_base< TYPE, MODULE >
virtual MODULE * get_module ()
 
- Protected Attributes inherited from sr_signal::signal_if< TYPE >
TYPE m_value
 The signal value. More...
 

Detailed Description

template<class TYPE, class MODULE>
class sr_signal::signal_infield< TYPE, MODULE >

This signal is an input signal which can be connected to multiple output signals. But altered from the input signal the infield has knowlage about the source of the arriving signal. Each output signal can be bound to a infield channel. Each hannel has its own value and the callback method can identiefy the seender.

Member Typedef Documentation

template<class TYPE , class MODULE >
typedef void(MODULE::* sr_signal::signal_infield< TYPE, MODULE >::t_callback)(const TYPE &value, const uint32_t &channel, const sc_core::sc_time &time)

Callback method type The callback method must be a function with 3 parameters:

Parameters
valueThe new value of the signal.
channelThe input channel of the signal.
timeThe delay of the signal.

Constructor & Destructor Documentation

template<class TYPE , class MODULE >
sr_signal::signal_infield< TYPE, MODULE >::signal_infield ( sc_core::sc_module_name  mn = NULL)
inline

Constructor without callback

Parameters
mnSystemC Signal Name
template<class TYPE , class MODULE >
sr_signal::signal_infield< TYPE, MODULE >::signal_infield ( t_callback  callback,
sc_core::sc_module_name  mn = NULL 
)
inline

Constructor with callback

Parameters
callbackCallback in the base class to be executed each time a value changes.
mnSystemC Signal Name
template<class TYPE , class MODULE >
virtual sr_signal::signal_infield< TYPE, MODULE >::~signal_infield ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

template<class TYPE , class MODULE >
virtual void sr_signal::signal_infield< TYPE, MODULE >::bind ( signal_out_bind_if< TYPE > &  sender,
const uint32_t channel = 0 
)
inlinevirtual

Bind method. This method binds a specific input channel to a corresponding output. Each channel can be bind multiple times.

Parameters
senderInput interface to bind with.
channelThe channel which has to be bind.

Implements sr_signal::signal_in_if< TYPE >.

template<class TYPE , class MODULE >
void sr_signal::signal_infield< TYPE, MODULE >::operator() ( signal_out_bind_if< TYPE > &  sender,
uint32_t  channel 
)
inline

Connect the infield with an output on a specific channel.

References sr_signal::signal_out_bind_if< TYPE >::bind().

Here is the call graph for this function:

template<class TYPE , class MODULE >
TYPE sr_signal::signal_infield< TYPE, MODULE >::operator[] ( const uint32_t channel) const
inline

Gets the value of a specific channel.

References pysc::api::cci::read().

Here is the call graph for this function:

template<class TYPE , class MODULE >
TYPE sr_signal::signal_infield< TYPE, MODULE >::read ( const uint32_t channel) const
inline

Read the value of a specific channel. If the channel not exists –> error

Parameters
channelThe channel to read from.
Returns
The value of the channel.
template<class TYPE , class MODULE >
TYPE sr_signal::signal_infield< TYPE, MODULE >::read ( const uint32_t channel,
const TYPE &  default_value 
) const
inline

Safe read reads the value of a channel. If the channel not exists return default value.

Parameters
channelThe channel to read from.
default_valueThe default value to read in case of an error.
Returns
The value of the channel.
template<class TYPE , class MODULE >
virtual void sr_signal::signal_infield< TYPE, MODULE >::update ( signal_out_if< TYPE > *  sender,
const sc_core::sc_time &  time 
)
inlinevirtual

Update method. Updates the value of a channel and executes the callback.

Parameters
senderWich calls update.
timeDelay from sc_timestamp() after which the signal is set.

Implements sr_signal::signal_in_if< TYPE >.

References sr_signal::signal_if< TYPE >::read().

Here is the call graph for this function:


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