ForSyDe::UT::source< T > Class Template Reference

Process constructor for a source process. More...

#include <ut_process_constructors.hpp>

Inheritance diagram for ForSyDe::UT::source< T >:
Collaboration diagram for ForSyDe::UT::source< T >:

Public Types

typedef std::function< void(T &, const T &)> functype
 Type of the function to be passed to the process constructor.
 

Public Member Functions

 source (const sc_module_name &_name, const functype &_func, const T &init_val, const unsigned long long &take=0)
 The constructor requires the module name. More...
 
std::string forsyde_kind () const
 Specifying from which process constructor is the module built.
 
- Public Member Functions inherited from ForSyDe::process
 process (sc_module_name _name)
 The constructor requires the module name. More...
 

Public Attributes

UT_out< T > oport1
 port for the output channel
 

Additional Inherited Members

- Protected Member Functions inherited from ForSyDe::process
void end_of_simulation ()
 This hook is used to run the clean stage.
 

Detailed Description

template<class T>
class ForSyDe::UT::source< T >

Process constructor for a source process.

This class is used to build a souce process which only has an output. Given an initial state and a function, the process repeatedly applies the function to the current state to produce next state, which is also the process output. It can be used in test-benches.

Constructor & Destructor Documentation

template<class T>
ForSyDe::UT::source< T >::source ( const sc_module_name &  _name,
const functype _func,
const T &  init_val,
const unsigned long long &  take = 0 
)
inline

The constructor requires the module name.

It creates an SC_THREAD which runs the user-imlpemented function and writes the result using the output port

Parameters
_nameThe module name
_funcfunction to be passed
init_valInitial state
takenumber of tokens produced (0 for infinite)

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