qualcomm/qbox
Loading...
Searching...
No Matches
sc_core::sc_sync_window< sc_sync_policy > Class Template Reference

windowed synchronizer, template SYNC_POLICY gives the quantum (dynamically) and specifies if the window should stay open indefinitely or detach when there are no more events. More...

#include <sync_window.h>

Inheritance diagram for sc_core::sc_sync_window< sc_sync_policy >:
Collaboration diagram for sc_core::sc_sync_window< sc_sync_policy >:

Classes

struct  window

Public Member Functions

 SCP_LOGGER ()
void async_set_window (const window &w)
bool is_attached () const
 Check if the sync_window is currently attached.
void attach ()
 Attach to the primitive channel's suspend/resume mechanism for time synchronization.
void detach (const sc_core::sc_time now=sc_core::SC_ZERO_TIME)
 Detach from the primitive channel's suspend/resume mechanism and fully open the time window.
void bind (sc_sync_window *other)
void register_sync_cb (std::function< void(const window &)> fn)
 SC_CTOR (sc_sync_window)

Static Public Attributes

static const struct window zero_window = { sc_core::SC_ZERO_TIME, sc_core::SC_ZERO_TIME }
static const struct window open_window = { sc_core::SC_ZERO_TIME, sc_core::sc_max_time() }

Detailed Description

template<class sc_sync_policy = sc_sync_policy_in_sync>
class sc_core::sc_sync_window< sc_sync_policy >

windowed synchronizer, template SYNC_POLICY gives the quantum (dynamically) and specifies if the window should stay open indefinitely or detach when there are no more events.

Template Parameters
sc_sync_policy

Member Function Documentation

◆ attach()

template<class sc_sync_policy = sc_sync_policy_in_sync>
void sc_core::sc_sync_window< sc_sync_policy >::attach ( )
inline

Attach to the primitive channel's suspend/resume mechanism for time synchronization.

When attached, this sync_window actively participates in SystemC's suspend/resume protocol, allowing it to suspend simulation when synchronization windows are reached.

◆ detach()

template<class sc_sync_policy = sc_sync_policy_in_sync>
void sc_core::sc_sync_window< sc_sync_policy >::detach ( const sc_core::sc_time now = sc_core::SC_ZERO_TIME)
inline

Detach from the primitive channel's suspend/resume mechanism and fully open the time window.

When detached, this sync_window no longer participates in suspend/resume, meaning it cannot block simulation time advancement. Additionally, the synchronization window is set to [now, sc_max_time()], effectively removing all time restrictions and allowing the simulation to advance freely without waiting for the paired sync_window.

Parameters
nowStarting time for the unrestricted window (defaults to SC_ZERO_TIME)

◆ is_attached()

template<class sc_sync_policy = sc_sync_policy_in_sync>
bool sc_core::sc_sync_window< sc_sync_policy >::is_attached ( ) const
inline

Check if the sync_window is currently attached.

Returns
true if attached, false if detached

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