sync_task Class Reference

Collaboration diagram for sync_task:
Collaboration graph
[legend]

List of all members.

Public Member Functions

API exposed to the SystemC side

 sync_task (const boost::function< void()> &routine, const sc_core::sc_time &t=sc_core::SC_ZERO_TIME)
 Build a task running routine, of duration t.
void wait_for_completion ()
 Wait for the task to complete.
API Exposed to the During Task

void extra_time (const sc_core::sc_time &t)
 Increase the duration of the current task by t.
void catch_up (const sc_core::sc_time &t)
 Catch up with SystemC's time.
void sc_call (const boost::function< void()> &f)
 Call a function f from During task, in mutual exclusion with SystemC.
To be called by the thread_pool

void process ()
Testing purpose

void wait_nosc ()

Detailed Description

Definition at line 26 of file sync-task.h.


Constructor & Destructor Documentation

sync_task::sync_task ( const boost::function< void()> &  routine,
const sc_core::sc_time &  t = sc_core::SC_ZERO_TIME 
) [inline]

Build a task running routine, of duration t.

NOT thread-safe. Normally, this class should only be instanciated from SystemC threads. Otherwise, use big_lock to allow concurrent calls to the constructor.

Definition at line 122 of file sync-task.h.


Member Function Documentation

void sync_task::catch_up ( const sc_core::sc_time &  t  )  [inline]

Catch up with SystemC's time.

This causes the task to block until SystemC's time has advanced up to the end of the current task, or the end of the task minus t if it is non-null.

Definition at line 182 of file sync-task.h.

void sync_task::extra_time ( const sc_core::sc_time &  t  )  [inline]

Increase the duration of the current task by t.

The SystemC thread is notified, since it may allow it to run another sc_core::wait().

Definition at line 164 of file sync-task.h.

void sync_task::process (  )  [inline]

Runs the routine, and notify the SystemC thread when it's done.

Definition at line 235 of file sync-task.h.

void sync_task::sc_call ( const boost::function< void()> &  f  )  [inline]

Call a function f from During task, in mutual exclusion with SystemC.

f is scheduled to be executed next time the task synchronizes with SystemC. sc_call returns after this function is executed.

Definition at line 208 of file sync-task.h.

void sync_task::wait_for_completion (  )  [inline]

Wait for the task to complete.

Callable only from an SC_THREAD (normally, called only indirectly from during_if::during()).

On return, the SystemC time has advanced by the duration of the task, and the computation in the task is over.

Definition at line 139 of file sync-task.h.

void sync_task::wait_nosc (  )  [inline]

Function to be called for testing purpose, outside a SystemC thread.

It's a simple wrapper around wait()

Definition at line 264 of file sync-task.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Defines