クラス sc_core::sc_event

#include <sc_event.h>

すべてのメンバ一覧

Public メソッド

 sc_event ()
 ~sc_event ()
void cancel ()
void notify ()
void notify (const sc_time &)
void notify (double, sc_time_unit)
void notify_delayed ()
void notify_delayed (const sc_time &)
void notify_delayed (double, sc_time_unit)
sc_event_or_listoperator| (const sc_event &) const
sc_event_and_listoperator & (const sc_event &) const

Private 型

enum  notify_t { NONE, DELTA, TIMED }

Private メソッド

void add_static (sc_method_handle) const
void add_static (sc_thread_handle) const
void add_dynamic (sc_method_handle) const
void add_dynamic (sc_thread_handle) const
void notify_internal (const sc_time &)
void notify_next_delta ()
bool remove_static (sc_method_handle) const
bool remove_static (sc_thread_handle) const
bool remove_dynamic (sc_method_handle) const
bool remove_dynamic (sc_thread_handle) const
void reset ()
void trigger ()
 sc_event (const sc_event &)
sc_eventoperator= (const sc_event &)

Private 変数

sc_simcontextm_simc
notify_t m_notify_type
int m_delta_event_index
sc_event_timedm_timed
std::vector< sc_method_handlem_methods_static
std::vector< sc_method_handlem_methods_dynamic
std::vector< sc_thread_handlem_threads_static
std::vector< sc_thread_handlem_threads_dynamic

フレンド

class sc_clock
class sc_event_list
class sc_event_timed
class sc_simcontext
class sc_process_b
class sc_method_process
class sc_thread_process
class sc_signal
class sc_signal< bool >
class sc_signal< sc_dt::sc_logic >


説明

sc_event.h85 行で定義されています。


列挙型

列挙型の値:
NONE 
DELTA 
TIMED 

sc_event.h139 行で定義されています。

00139 { NONE, DELTA, TIMED };


コンストラクタとデストラクタ

sc_core::sc_event::sc_event (  )  [inline]

sc_event.h217 行で定義されています。

00218 : m_simc( sc_get_curr_simcontext() ),
00219   m_notify_type( NONE ),
00220   m_delta_event_index( -1 ),
00221   m_timed( 0 )
00222 {}

sc_core::sc_event::~sc_event (  )  [inline]

sc_event.h225 行で定義されています。

00226 {
00227     cancel();
00228 }

sc_core::sc_event::sc_event ( const sc_event  )  [private]


関数

void sc_core::sc_event::cancel (  ) 

sc_event.cpp77 行で定義されています。

00078 {
00079     // cancel a delta or timed notification
00080     switch( m_notify_type ) {
00081     case DELTA: {
00082         // remove this event from the delta events set
00083         m_simc->remove_delta_event( this );
00084         m_notify_type = NONE;
00085         break;
00086     }
00087     case TIMED: {
00088         // remove this event from the timed events set
00089         assert( m_timed != 0 );
00090         m_timed->m_event = 0;
00091         m_timed = 0;
00092         m_notify_type = NONE;
00093         break;
00094     }
00095     default:
00096         ;
00097     }
00098 }

void sc_core::sc_event::notify (  ) 

sc_event.cpp102 行で定義されています。

00103 {
00104     // immediate notification
00105     if( m_simc->update_phase() ) {
00106         SC_REPORT_ERROR( SC_ID_IMMEDIATE_NOTIFICATION_, "" );
00107     }
00108     cancel();
00109     trigger();
00110 }

void sc_core::sc_event::notify ( const sc_time t  ) 

sc_event.cpp113 行で定義されています。

00114 {
00115     if( m_notify_type == DELTA ) {
00116         return;
00117     }
00118     if( t == SC_ZERO_TIME ) {
00119         if( m_notify_type == TIMED ) {
00120             // remove this event from the timed events set
00121             assert( m_timed != 0 );
00122             m_timed->m_event = 0;
00123             m_timed = 0;
00124         }
00125         // add this event to the delta events set
00126         m_delta_event_index = m_simc->add_delta_event( this );
00127         m_notify_type = DELTA;
00128         return;
00129     }
00130     if( m_notify_type == TIMED ) {
00131         assert( m_timed != 0 );
00132         if( m_timed->m_notify_time <= m_simc->time_stamp() + t ) {
00133             return;
00134         }
00135         // remove this event from the timed events set
00136         m_timed->m_event = 0;
00137         m_timed = 0;
00138     }
00139     // add this event to the timed events set
00140     sc_event_timed* et = new sc_event_timed( this, m_simc->time_stamp() + t );
00141     m_simc->add_timed_event( et );
00142     m_timed = et;
00143     m_notify_type = TIMED;
00144 }

void sc_core::sc_event::notify ( double  v,
sc_time_unit  tu 
) [inline]

sc_event.h232 行で定義されています。

00233 {
00234     notify( sc_time( v, tu, m_simc ) );
00235 }

void sc_core::sc_event::notify_delayed (  ) 

sc_event.cpp158 行で定義されています。

00159 {
00160     sc_warn_notify_delayed();
00161     if( m_notify_type != NONE ) {
00162         SC_REPORT_ERROR( SC_ID_NOTIFY_DELAYED_, 0 );
00163     }
00164     // add this event to the delta events set
00165     m_delta_event_index = m_simc->add_delta_event( this );
00166     m_notify_type = DELTA;
00167 }

void sc_core::sc_event::notify_delayed ( const sc_time t  ) 

sc_event.cpp170 行で定義されています。

00171 {
00172     sc_warn_notify_delayed();
00173     if( m_notify_type != NONE ) {
00174         SC_REPORT_ERROR( SC_ID_NOTIFY_DELAYED_, 0 );
00175     }
00176     if( t == SC_ZERO_TIME ) {
00177         // add this event to the delta events set
00178         m_delta_event_index = m_simc->add_delta_event( this );
00179         m_notify_type = DELTA;
00180     } else {
00181         // add this event to the timed events set
00182         sc_event_timed* et = new sc_event_timed( this,
00183                                                  m_simc->time_stamp() + t );
00184         m_simc->add_timed_event( et );
00185         m_timed = et;
00186         m_notify_type = TIMED;
00187     }
00188 }

void sc_core::sc_event::notify_delayed ( double  v,
sc_time_unit  tu 
) [inline]

sc_event.h269 行で定義されています。

00270 {
00271     notify_delayed( sc_time( v, tu, m_simc ) );
00272 }

sc_event_or_list & sc_core::sc_event::operator| ( const sc_event e2  )  const [inline]

sc_event.h449 行で定義されています。

00450 {
00451     sc_event_or_list* el = new sc_event_or_list( *this, true );
00452     el->push_back( e2 );
00453     return *el;
00454 }

sc_event_and_list & sc_core::sc_event::operator & ( const sc_event e2  )  const [inline]

sc_event.h510 行で定義されています。

00511 {
00512     sc_event_and_list* el = new sc_event_and_list( *this, true );
00513     el->push_back( e2 );
00514     return *el;
00515 }

void sc_core::sc_event::add_static ( sc_method_handle  method_h  )  const [inline, private]

sc_event.h277 行で定義されています。

00278 {
00279     m_methods_static.push_back( method_h );
00280 }

void sc_core::sc_event::add_static ( sc_thread_handle  thread_h  )  const [inline, private]

sc_event.h284 行で定義されています。

00285 {
00286     m_threads_static.push_back( thread_h );
00287 }

void sc_core::sc_event::add_dynamic ( sc_method_handle  method_h  )  const [inline, private]

sc_event.h291 行で定義されています。

00292 {
00293     m_methods_dynamic.push_back( method_h );
00294 }

void sc_core::sc_event::add_dynamic ( sc_thread_handle  thread_h  )  const [inline, private]

sc_event.h298 行で定義されています。

00299 {
00300     m_threads_dynamic.push_back( thread_h );
00301 }

void sc_core::sc_event::notify_internal ( const sc_time t  )  [inline, private]

sc_event.h240 行で定義されています。

00241 {
00242     if( t == SC_ZERO_TIME ) {
00243         // add this event to the delta events set
00244         m_delta_event_index = m_simc->add_delta_event( this );
00245         m_notify_type = DELTA;
00246     } else {
00247         sc_event_timed* et =
00248                 new sc_event_timed( this, m_simc->time_stamp() + t );
00249         m_simc->add_timed_event( et );
00250         m_timed = et;
00251         m_notify_type = TIMED;
00252     }
00253 }

void sc_core::sc_event::notify_next_delta (  )  [inline, private]

sc_event.h257 行で定義されています。

00258 {
00259     if( m_notify_type != NONE ) {
00260         SC_REPORT_ERROR( SC_ID_NOTIFY_DELAYED_, 0 );
00261     }
00262     // add this event to the delta events set
00263     m_delta_event_index = m_simc->add_delta_event( this );
00264     m_notify_type = DELTA;
00265 }

bool sc_core::sc_event::remove_static ( sc_method_handle  method_h_  )  const [private]

sc_event.cpp269 行で定義されています。

00270 {
00271     int size;
00272     if ( ( size = m_methods_static.size() ) != 0 ) {
00273       sc_method_handle* l_methods_static = &m_methods_static[0];
00274       for( int i = size - 1; i >= 0; -- i ) {
00275           if( l_methods_static[i] == method_h_ ) {
00276               l_methods_static[i] = l_methods_static[size - 1];
00277               m_methods_static.resize(size-1);
00278               return true;
00279           }
00280       }
00281     }
00282     return false;
00283 }

bool sc_core::sc_event::remove_static ( sc_thread_handle  thread_h_  )  const [private]

sc_event.cpp286 行で定義されています。

00287 {
00288     int size;
00289     if ( ( size = m_threads_static.size() ) != 0 ) {
00290       sc_thread_handle* l_threads_static = &m_threads_static[0];
00291       for( int i = size - 1; i >= 0; -- i ) {
00292           if( l_threads_static[i] == thread_h_ ) {
00293               l_threads_static[i] = l_threads_static[size - 1];
00294               m_threads_static.resize(size-1);
00295               return true;
00296           }
00297       }
00298     }
00299     return false;
00300 }

bool sc_core::sc_event::remove_dynamic ( sc_method_handle  method_h_  )  const [private]

sc_event.cpp303 行で定義されています。

00304 {
00305     int size;
00306     if ( ( size = m_methods_dynamic.size() ) != 0 ) {
00307       sc_method_handle* l_methods_dynamic = &m_methods_dynamic[0];
00308       for( int i = size - 1; i >= 0; -- i ) {
00309           if( l_methods_dynamic[i] == method_h_ ) {
00310               l_methods_dynamic[i] = l_methods_dynamic[size - 1];
00311               m_methods_dynamic.resize(size-1);
00312               return true;
00313           }
00314       }
00315     }
00316     return false;
00317 }

bool sc_core::sc_event::remove_dynamic ( sc_thread_handle  thread_h_  )  const [private]

sc_event.cpp320 行で定義されています。

00321 {
00322     int size;
00323     if ( ( size= m_threads_dynamic.size() ) != 0 ) {
00324       sc_thread_handle* l_threads_dynamic = &m_threads_dynamic[0];
00325       for( int i = size - 1; i >= 0; -- i ) {
00326           if( l_threads_dynamic[i] == thread_h_ ) {
00327               l_threads_dynamic[i] = l_threads_dynamic[size - 1];
00328               m_threads_dynamic.resize(size-1);
00329               return true;
00330           }
00331       }
00332     }
00333     return false;
00334 }

void sc_core::sc_event::reset (  )  [private]

sc_event.cpp191 行で定義されています。

00192 {
00193     m_notify_type = NONE;
00194     m_delta_event_index = -1;
00195     m_timed = 0;
00196     // clear the dynamic sensitive methods
00197     m_methods_dynamic.resize(0);
00198     // clear the dynamic sensitive threads
00199     m_threads_dynamic.resize(0);
00200 }

void sc_core::sc_event::trigger (  )  [private]

sc_event.cpp204 行で定義されています。

00205 {
00206     int size;
00207 
00208     // trigger the static sensitive methods
00209 
00210     if( ( size = m_methods_static.size() ) != 0 ) {
00211         sc_method_handle* l_methods_static = &m_methods_static[0];
00212         int i = size - 1;
00213         do {
00214             sc_method_handle method_h = l_methods_static[i];
00215             if( method_h->trigger_static() ) {
00216                 m_simc->push_runnable_method( method_h );
00217             }
00218         } while( -- i >= 0 );
00219     }
00220 
00221     // trigger the dynamic sensitive methods
00222 
00223     if( ( size = m_methods_dynamic.size() ) != 0 ) {
00224         sc_method_handle* l_methods_dynamic = &m_methods_dynamic[0];
00225         int i = size - 1;
00226         do {
00227             sc_method_handle method_h = l_methods_dynamic[i];
00228             if( method_h->trigger_dynamic( this ) ) {
00229                 m_simc->push_runnable_method( method_h );
00230             }
00231         } while( -- i >= 0 );
00232         m_methods_dynamic.resize(0);
00233     }
00234 
00235     // trigger the static sensitive threads
00236 
00237     if( ( size = m_threads_static.size() ) != 0 ) {
00238         sc_thread_handle* l_threads_static = &m_threads_static[0];
00239         int i = size - 1;
00240         do {
00241             sc_thread_handle thread_h = l_threads_static[i];
00242             if( thread_h->trigger_static() ) {
00243                 m_simc->push_runnable_thread( thread_h );
00244             }
00245         } while( -- i >= 0 );
00246     }
00247 
00248     // trigger the dynamic sensitive threads
00249 
00250     if( ( size = m_threads_dynamic.size() ) != 0 ) {
00251         sc_thread_handle* l_threads_dynamic = &m_threads_dynamic[0];
00252         int i = size - 1;
00253         do {
00254             sc_thread_handle thread_h = l_threads_dynamic[i];
00255             if( thread_h->trigger_dynamic( this ) ) {
00256                 m_simc->push_runnable_thread( thread_h );
00257             }
00258         } while( -- i >= 0 );
00259         m_threads_dynamic.resize(0);
00260     }
00261 
00262     m_notify_type = NONE;
00263     m_delta_event_index = -1;
00264     m_timed = 0;
00265 }

sc_event& sc_core::sc_event::operator= ( const sc_event  )  [private]


フレンドと関連する関数

friend class sc_clock [friend]

sc_event.h87 行で定義されています。

friend class sc_event_list [friend]

sc_event.h88 行で定義されています。

friend class sc_event_timed [friend]

sc_event.h89 行で定義されています。

friend class sc_simcontext [friend]

sc_event.h90 行で定義されています。

friend class sc_process_b [friend]

sc_event.h91 行で定義されています。

friend class sc_method_process [friend]

sc_event.h92 行で定義されています。

friend class sc_thread_process [friend]

sc_event.h93 行で定義されています。

friend class sc_signal [friend]

sc_event.h94 行で定義されています。

friend class sc_signal< bool > [friend]

sc_event.h95 行で定義されています。

friend class sc_signal< sc_dt::sc_logic > [friend]

sc_event.h96 行で定義されています。


変数

sc_event.h141 行で定義されています。

sc_event.h142 行で定義されています。

sc_event.h143 行で定義されています。

sc_event.h144 行で定義されています。

std::vector<sc_method_handle> sc_core::sc_event::m_methods_static [mutable, private]

sc_event.h146 行で定義されています。

std::vector<sc_method_handle> sc_core::sc_event::m_methods_dynamic [mutable, private]

sc_event.h147 行で定義されています。

std::vector<sc_thread_handle> sc_core::sc_event::m_threads_static [mutable, private]

sc_event.h148 行で定義されています。

std::vector<sc_thread_handle> sc_core::sc_event::m_threads_dynamic [mutable, private]

sc_event.h149 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:11:58 2008に生成されました。  doxygen 1.5.6