42 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) 44 #pragma warning(disable: 4251) // DLL import for std::string 53 class sc_event_or_list;
54 class sc_event_and_list;
56 class sc_signal_channel;
67 template<
typename T >
77 : m_expr( new T(true) )
105 m_expr->push_back(el);
107 operator T
const &()
const 118 mutable type * m_expr;
153 bool auto_delete_ =
false );
160 bool and_list()
const;
168 bool temporary()
const;
169 void auto_delete()
const;
171 void report_premature_destruction()
const;
172 void report_invalid_modification()
const;
176 std::vector<const sc_event*> m_events;
179 mutable unsigned m_busy;
279 explicit sc_event(
const char* name );
284 const char*
name()
const {
return m_name.c_str(); }
285 const char* basename()
const;
293 void notify_delayed();
294 void notify_delayed(
const sc_time& );
303 bool triggered()
const;
315 void notify_internal(
const sc_time& );
316 void notify_next_delta();
323 void register_event(
const char* name,
bool is_kernel_event =
false );
330 enum notify_t { NONE, DELTA, TIMED };
336 notify_t m_notify_type;
337 int m_delta_event_index;
340 mutable std::vector<sc_method_handle> m_methods_static;
341 mutable std::vector<sc_method_handle> m_methods_dynamic;
342 mutable std::vector<sc_thread_handle> m_threads_static;
343 mutable std::vector<sc_thread_handle> m_threads_dynamic;
346 static struct kernel_tag {} kernel_event;
347 explicit sc_event( kernel_tag,
const char* name = NULL );
370 : m_event( e ), m_notify_time( t )
374 {
if( m_event != 0 ) { m_event->m_timed = 0; } }
379 const sc_time& notify_time()
const 380 {
return m_notify_time; }
382 static void*
operator new( std::size_t )
383 {
return allocate(); }
385 static void operator delete(
void* p, std::size_t )
391 static void* allocate();
392 static void deallocate(
void* );
420 sc_event::notify_internal(
const sc_time& t )
424 m_delta_event_index = m_simc->add_delta_event(
this );
425 m_notify_type = DELTA;
429 m_simc->add_timed_event( et );
431 m_notify_type = TIMED;
437 sc_event::notify_next_delta()
439 if( m_notify_type != NONE ) {
443 m_delta_event_index = m_simc->add_delta_event(
this );
444 m_notify_type = DELTA;
451 notify_delayed(
sc_time( v, tu, m_simc ) );
459 m_methods_static.push_back( method_h );
466 m_threads_static.push_back( thread_h );
473 m_methods_dynamic.push_back( method_h );
480 m_threads_dynamic.push_back( thread_h );
498 , m_and_list( and_list_ )
499 , m_auto_delete( auto_delete_ )
509 , m_and_list( and_list_ )
510 , m_auto_delete( auto_delete_ )
513 m_events.push_back( &e );
519 , m_and_list( that.m_and_list )
520 , m_auto_delete( false )
555 m_events.swap( that.m_events );
563 swap( const_cast<sc_event_list&>(that) );
565 m_events = that.m_events;
573 return static_cast<int>(m_events.size());
596 return m_auto_delete && ! m_busy;
606 if( ! m_busy && m_auto_delete ) {
658 sc_event_or_expr expr;
668 sc_event_or_expr expr;
681 sc_event_or_expr expr;
691 sc_event_or_expr expr;
777 sc_event_and_expr expr;
787 sc_event_and_expr expr;
799 sc_event_and_expr expr;
809 sc_event_and_expr expr;
835 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) sc_event_list & operator=(const sc_event_list &)
sc_event_and_expr operator&(const sc_event &) const
SC_API const sc_time SC_ZERO_TIME
Abstract base class of all SystemC `simulation' objects.
void push_back(sc_event const &e) const
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
sc_event_or_list & operator|=(const sc_event &)
The sc_semaphore primitive channel class.
friend class sc_event_and_list
sc_event_expr< sc_event_or_list > operator|(const sc_event &) const
The sc_mutex primitive channel class.
Base class for lists of events.
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
sc_event_and_list & operator&=(const sc_event &)
static const sc_event none
sc_object * get_parent_object() const
void report_invalid_modification() const
void swap(sc_event_and_list &)
friend class sc_event_or_list
The event expression class.
T const & release() const
void sc_thread_cor_fn(void *arg)
void move_from(const sc_event_list &)
void swap(sc_event_or_list &)
void report_premature_destruction() const
sc_event_list(const sc_event_list &)
void push_back(const sc_event &)
const char * name() const
sc_event_or_expr operator|(const sc_event &) const
Definition of the simulation context class.
sc_event_expr< sc_event_and_list > sc_event_and_expr
class sc_thread_process * sc_thread_handle
class sc_method_process * sc_method_handle
sc_event_expr< sc_event_and_list > operator&(const sc_event &)
Report ids for the kernel code.
sc_event_expr< sc_event_or_list > sc_event_or_expr
#define SC_REPORT_ERROR(msg_type, msg)
sc_event_or_expr operator|(sc_event_or_expr expr, sc_event const &e)
The sc_signal<T> writer policy definition.
bool in_hierarchy() const
void push_back(type const &el) const
sc_event_and_expr operator&(sc_event_and_expr expr, sc_event const &e)
sc_event_expr(sc_event_expr const &e)
void swap(sc_event_list &)
sc_time_unit
Enumeration of time units.
SC_API int sc_notify_time_compare(const void *, const void *)