ForSyDe::SY::file_source< T > Class Template Reference

Process constructor for a file_source process. More...

#include <sy_process_constructors.hpp>

Inheritance diagram for ForSyDe::SY::file_source< T >:
Collaboration diagram for ForSyDe::SY::file_source< T >:

Public Types

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

Public Member Functions

 file_source (sc_module_name _name, functype _func, std::string file_name)
 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

SY_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::SY::file_source< T >

Process constructor for a file_source process.

This class is used to build a souce process which only has an output. Given a file name and a function, the process repeatedly reads lines from the text file and applies the function to convert it to a value which will be written to the output. It can be used in test-benches.

Constructor & Destructor Documentation

template<class T>
ForSyDe::SY::file_source< T >::file_source ( sc_module_name  _name,
functype  _func,
std::string  file_name 
)
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
_nameprocess name
_funcfunction to be passed
file_namethe file name

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