diff --git a/src/sysc/communication/sc_event_finder.h b/src/sysc/communication/sc_event_finder.h index d9f2ea0d7..2b92fd552 100644 --- a/src/sysc/communication/sc_event_finder.h +++ b/src/sysc/communication/sc_event_finder.h @@ -123,9 +123,10 @@ const sc_event& sc_event_finder_t::find_event( sc_interface* if_p ) const { const IF* iface = ( if_p ) ? dynamic_cast( if_p ) : - dynamic_cast( port().get_interface() ); + dynamic_cast( port().get_interface() ); if( iface == 0 ) { - report_error( SC_ID_FIND_EVENT_, "port is not bound" ); + report_error( SC_ID_FIND_EVENT_, "port is not bound" ); + return sc_event::none; } return (const_cast( iface )->*m_event_method) (); } diff --git a/src/sysc/communication/sc_interface.cpp b/src/sysc/communication/sc_interface.cpp index 9dab610f6..7f7b8a62e 100644 --- a/src/sysc/communication/sc_interface.cpp +++ b/src/sysc/communication/sc_interface.cpp @@ -52,7 +52,7 @@ const sc_event& sc_interface::default_event() const { SC_REPORT_WARNING( SC_ID_NO_DEFAULT_EVENT_, 0 ); - return m_never_notified; + return sc_event::none; } @@ -67,12 +67,6 @@ sc_interface::~sc_interface() sc_interface::sc_interface() {} - -// special event for never notified cases, note the special name to keep -// it out of the named event structures. - -sc_event sc_interface::m_never_notified( sc_event::kernel_event ); - } // namespace sc_core // $Log: sc_interface.cpp,v $ diff --git a/src/sysc/communication/sc_interface.h b/src/sysc/communication/sc_interface.h index b1cefc7de..40dc78c7b 100644 --- a/src/sysc/communication/sc_interface.h +++ b/src/sysc/communication/sc_interface.h @@ -68,17 +68,6 @@ class SC_API sc_interface // disabled sc_interface( const sc_interface& ); sc_interface& operator = ( const sc_interface& ); - -private: - - static sc_event m_never_notified; - -#if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x520) - // Workaround for a bug in the Sun WorkShop 6 update 2 compiler. - // An empty virtual base class can cause the optimizer to - // generate wrong code. - char dummy; -#endif }; } // namespace sc_core diff --git a/src/sysc/kernel/sc_event.cpp b/src/sysc/kernel/sc_event.cpp index 36eb9fe06..c9a12c928 100644 --- a/src/sysc/kernel/sc_event.cpp +++ b/src/sysc/kernel/sc_event.cpp @@ -52,6 +52,9 @@ using std::strncmp; // The event class. // ---------------------------------------------------------------------------- +// kernel-internal event, that is never notified +const sc_event sc_event::none( kernel_event, "none" ); + const char* sc_event::basename() const { diff --git a/src/sysc/kernel/sc_event.h b/src/sysc/kernel/sc_event.h index 0805bb559..26768a195 100644 --- a/src/sysc/kernel/sc_event.h +++ b/src/sysc/kernel/sc_event.h @@ -260,7 +260,6 @@ class SC_API sc_event friend class sc_method_process; friend class sc_thread_process; friend void sc_thread_cor_fn( void* arg ); - friend class sc_interface; friend class sc_clock; friend class sc_event_queue; friend class sc_signal_channel; @@ -295,6 +294,8 @@ class SC_API sc_event sc_event_and_expr operator & ( const sc_event& ) const; sc_event_and_expr operator & ( const sc_event_and_list& ) const; + // never notified event + static const sc_event none; private: diff --git a/src/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h b/src/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h index 14ff0b3b3..4ca042857 100644 --- a/src/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h +++ b/src/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h @@ -66,6 +66,7 @@ tlm_event_finder_t::find_event( sc_core::sc_interface* if_p ) const dynamic_cast( port().get_interface() ); if( iface == 0 ) { report_error( sc_core::SC_ID_FIND_EVENT_, "port is not bound" ); + return sc_core::sc_event::none; } return (const_cast( iface )->*m_event_method) ( 0 ); }