#include <sc_process.h>
sc_process.h の 255 行で定義されています。
sc_process.h の 280 行で定義されています。
00281 { 00282 STATIC, 00283 EVENT, 00284 OR_LIST, 00285 AND_LIST, 00286 TIMEOUT, 00287 EVENT_TIMEOUT, 00288 OR_LIST_TIMEOUT, 00289 AND_LIST_TIMEOUT 00290 };
sc_core::sc_process_b::sc_process_b | ( | const char * | name_p, | |
bool | free_host, | |||
SC_ENTRY_FUNC | method_p, | |||
sc_process_host * | host_p, | |||
const sc_spawn_options * | opt_p | |||
) |
sc_process.cpp の 257 行で定義されています。
00260 : 00261 sc_object( name_p ), 00262 proc_id( simcontext()->next_proc_id()), 00263 m_dont_init( false ), 00264 m_dynamic_proc( simcontext()->elaboration_done() ), 00265 m_event_p(0), 00266 m_event_list_p(0), 00267 m_exist_p(0), 00268 m_free_host( free_host ), 00269 m_last_report_p(0), 00270 m_name_gen_p(0), 00271 m_process_kind(SC_NO_PROC_), 00272 m_references_n(1), 00273 m_reset_p(0), 00274 m_runnable_p(0), 00275 m_semantics_host_p( host_p ), 00276 m_semantics_method_p ( method_p ), 00277 m_term_event_p(0), 00278 m_throw_type( THROW_NONE ), 00279 m_timed_out(false), 00280 m_timeout_event_p(new sc_event), 00281 m_trigger_type(STATIC), 00282 m_zombie(false) 00283 { 00284 00285 // THIS OBJECT INSTANCE IS NOW THE LAST CREATED PROCESS: 00286 00287 m_last_created_process_p = this; 00288 00289 }
sc_core::sc_process_b::~sc_process_b | ( | ) | [virtual] |
sc_process.cpp の 296 行で定義されています。
00297 { 00298 00299 // REDIRECT ANY CHILDREN AS CHILDREN OF THE SIMULATION CONTEXT: 00300 00301 int size = m_child_objects.size(); 00302 for(int i = 0; i < size; i++) 00303 { 00304 sc_object* obj_p = m_child_objects[i]; 00305 obj_p->m_parent = NULL; 00306 simcontext()->add_child_object(obj_p); 00307 } 00308 00309 00310 // DELETE SEMANTICS OBJECTS IF NEED BE: 00311 00312 if ( m_free_host ) delete m_semantics_host_p; 00313 # if !defined(SC_USE_MEMBER_FUNC_PTR) // Remove invocation object. 00314 delete m_semantics_method_p; 00315 # endif 00316 00317 00318 // REMOVE ANY STRUCTURES THAT MAY HAVE BEEN BUILT: 00319 00320 if ( m_name_gen_p ) delete m_name_gen_p; 00321 if ( m_last_report_p ) delete m_last_report_p; 00322 if ( m_term_event_p ) delete m_term_event_p; 00323 if ( m_timeout_event_p ) delete m_timeout_event_p; 00324 00325 }
bool sc_core::sc_process_b::dont_initialize | ( | ) | const [inline] |
void sc_core::sc_process_b::dont_initialize | ( | bool | dont | ) | [virtual] |
sc_core::sc_cthread_processで再定義されています。
sc_process.cpp の 131 行で定義されています。
00132 { 00133 m_dont_init = dont; 00134 }
const ::std::vector< sc_object * > & sc_core::sc_process_b::get_child_objects | ( | ) | const [inline, virtual] |
sc_core::sc_objectを再定義しています。
sc_process.h の 409 行で定義されています。
00410 { 00411 return m_child_objects; 00412 }
sc_curr_proc_kind sc_core::sc_process_b::proc_kind | ( | ) | const [inline] |
sc_event & sc_core::sc_process_b::terminated_event | ( | ) |
sc_process.cpp の 334 行で定義されています。
00335 { 00336 if ( m_process_kind == SC_METHOD_PROC_ ) 00337 SC_REPORT_WARNING(SC_ID_METHOD_TERMINATION_EVENT_,""); 00338 if ( !m_term_event_p ) m_term_event_p = new sc_event; 00339 return *m_term_event_p; 00340 }
sc_process_handle sc_core::sc_process_b::last_created_process_handle | ( | ) | [inline, static] |
sc_process_handle.h の 275 行で定義されています。
00276 { 00277 return sc_process_handle(m_last_created_process_p); 00278 }
void sc_core::sc_process_b::add_static_event | ( | const sc_event & | e | ) | [protected] |
sc_process.cpp の 88 行で定義されています。
00089 { 00090 sc_method_handle method_h; // This process as a method. 00091 sc_thread_handle thread_h; // This process as a thread. 00092 00093 00094 // CHECK TO SEE IF WE ARE ALREADY REGISTERED WITH THE EVENT: 00095 00096 for( int i = m_static_events.size() - 1; i >= 0; -- i ) { 00097 if( &e == m_static_events[i] ) { 00098 return; 00099 } 00100 } 00101 00102 // REMEMBER THE EVENT AND THEN REGISTER OUR OBJECT INSTANCE WITH IT: 00103 00104 m_static_events.push_back( &e ); 00105 00106 switch ( m_process_kind ) 00107 { 00108 case SC_THREAD_PROC_: 00109 case SC_CTHREAD_PROC_: 00110 thread_h = DCAST<sc_thread_handle>( this ); 00111 assert( thread_h != 0 ); 00112 e.add_static( thread_h ); 00113 break; 00114 case SC_METHOD_PROC_: 00115 method_h = DCAST<sc_method_handle>( this ); 00116 assert( method_h != 0 ); 00117 e.add_static( method_h ); 00118 break; 00119 default: 00120 assert( false ); 00121 break; 00122 } 00123 }
bool sc_core::sc_process_b::dynamic | ( | ) | const [inline, protected] |
const char * sc_core::sc_process_b::gen_unique_name | ( | const char * | basename_, | |
bool | preserve_first | |||
) | [protected] |
sc_process.cpp の 142 行で定義されています。
00144 { 00145 if ( ! m_name_gen_p ) m_name_gen_p = new sc_name_gen; 00146 return m_name_gen_p->gen_unique_name( basename_, preserve_first ); 00147 }
sc_report* sc_core::sc_process_b::get_last_report | ( | ) | [inline, protected] |
bool sc_core::sc_process_b::is_runnable | ( | ) | [inline, protected] |
sc_process_b * sc_core::sc_process_b::last_created_process_base | ( | ) | [inline, static, protected] |
void sc_core::sc_process_b::set_last_report | ( | sc_report * | last_p | ) | [inline, protected] |
sc_process.h の 315 行で定義されています。
00316 { 00317 if ( m_last_report_p ) delete m_last_report_p; 00318 m_last_report_p = last_p; 00319 }
void sc_core::sc_process_b::remove_static_events | ( | ) | [protected] |
sc_process.cpp の 221 行で定義されています。
00222 { 00223 sc_method_handle method_h; // This process as a method. 00224 sc_thread_handle thread_h; // This process as a thread. 00225 00226 switch ( m_process_kind ) 00227 { 00228 case SC_THREAD_PROC_: 00229 case SC_CTHREAD_PROC_: 00230 thread_h = DCAST<sc_thread_handle>( this ); 00231 assert( thread_h != 0 ); 00232 for( int i = m_static_events.size() - 1; i >= 0; -- i ) { 00233 m_static_events[i]->remove_static( thread_h ); 00234 } 00235 m_static_events.resize(0); 00236 break; 00237 case SC_METHOD_PROC_: 00238 method_h = DCAST<sc_method_handle>( this ); 00239 assert( method_h != 0 ); 00240 for( int i = m_static_events.size() - 1; i >= 0; -- i ) { 00241 m_static_events[i]->remove_static( method_h ); 00242 } 00243 m_static_events.resize(0); 00244 break; 00245 default: // Some other type, it needs to clean up itself. 00246 // std::cout << "Check " << __FILE__ << ":" << __LINE__ << std::endl; 00247 break; 00248 } 00249 }
bool sc_core::sc_process_b::trigger_static | ( | ) | [inline, protected] |
sc_process.h の 551 行で定義されています。
00552 { 00553 return ( !is_runnable() && m_trigger_type == STATIC ); 00554 }
bool sc_core::sc_process_b::timed_out | ( | ) | const [inline, protected] |
void sc_core::sc_process_b::add_child_object | ( | sc_object * | object_ | ) | [inline, private] |
sc_process.h の 388 行で定義されています。
00389 { 00390 // no check if object_ is already in the set 00391 m_child_objects.push_back( object_ ); 00392 }
void sc_core::sc_process_b::remove_child_object | ( | sc_object * | object_ | ) | [inline, private] |
sc_process.h の 395 行で定義されています。
00396 { 00397 int size = m_child_objects.size(); 00398 for( int i = 0; i < size; ++ i ) { 00399 if( object_ == m_child_objects[i] ) { 00400 m_child_objects[i] = m_child_objects[size - 1]; 00401 m_child_objects.resize(size-1); 00402 return; 00403 } 00404 } 00405 // no check if object_ is really in the set 00406 }
void sc_core::sc_process_b::kill_process | ( | ) | [protected, virtual] |
sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。
sc_process.cpp の 157 行で定義されています。
00158 { 00159 sc_method_handle method_h; // This process as a method. 00160 sc_thread_handle thread_h; // This process as a thread. 00161 00162 if ( m_zombie ) return; // Nothing to be done. 00163 00164 00165 // REMOVE ANY DYNAMIC WAITS 00166 00167 switch ( m_process_kind ) 00168 { 00169 case SC_THREAD_PROC_: 00170 case SC_CTHREAD_PROC_: 00171 thread_h = DCAST<sc_thread_handle>(this); 00172 assert( thread_h ); 00173 if ( m_event_p ) m_event_p->remove_dynamic( thread_h ); 00174 if ( m_event_list_p ) 00175 { 00176 m_event_list_p->remove_dynamic( thread_h, 0 ); 00177 m_event_list_p->auto_delete(); 00178 } 00179 break; 00180 case SC_METHOD_PROC_: 00181 method_h = DCAST<sc_method_handle>(this); 00182 assert( method_h ); 00183 if ( m_event_p ) m_event_p->remove_dynamic( method_h ); 00184 if ( m_event_list_p ) 00185 { 00186 m_event_list_p->remove_dynamic( method_h, 0 ); 00187 m_event_list_p->auto_delete(); 00188 } 00189 break; 00190 default: // Some other type, it needs to clean up itself. 00191 // std::cout << "Check " << __FILE__ << ":" << __LINE__ << std::endl; 00192 break; 00193 } 00194 00195 00196 // REMOVE STATIC WAITS, AND REMOVE THE PROCESS FROM ITS SC_RESET: 00197 00198 remove_static_events(); 00199 if ( m_reset_p ) m_reset_p->remove_process( this ); 00200 00201 00202 // FIRE THE TERMINATION EVENT, MARK AS TERMINATED, AND DECREMENT THE COUNT: 00203 // 00204 // (1) We wait to set the process kind until after doing the removals 00205 // above. 00206 // (2) Decrementing the reference count will result in actual object 00207 // deletion if we hit zero. 00208 00209 m_zombie = true; 00210 if ( m_term_event_p ) m_term_event_p->notify(); 00211 reference_decrement(); 00212 }
void sc_core::sc_process_b::reset_changed | ( | ) | [inline, protected] |
sc_process.h の 492 行で定義されています。
00493 { 00494 m_throw_type = ( m_reset_p->read() == m_reset_level ) ? 00495 THROW_RESET : THROW_NONE; 00496 }
bool sc_core::sc_process_b::terminated | ( | ) | const [inline, protected, virtual] |
void sc_core::sc_process_b::reference_decrement | ( | ) | [inline, private] |
sc_process.h の 461 行で定義されています。
00462 { 00463 m_references_n--; 00464 if ( m_references_n == 0 ) 00465 { 00466 if ( m_delete_next_p ) delete m_delete_next_p; 00467 assert(m_delete_next_p != this); 00468 m_delete_next_p = this; 00469 } 00470 }
void sc_core::sc_process_b::reference_increment | ( | ) | [inline, private] |
sc_process.h の 479 行で定義されています。
00480 { 00481 assert(m_references_n != 0); 00482 m_references_n++; 00483 }
void sc_core::sc_process_b::semantics | ( | ) | [inline, protected] |
sc_process.h の 506 行で定義されています。
00507 { 00508 assert( m_process_kind != SC_NO_PROC_ ); 00509 m_throw_type = ( m_reset_p && m_reset_p->read() == m_reset_level ) ? 00510 THROW_RESET : THROW_NONE; 00511 # ifndef SC_USE_MEMBER_FUNC_PTR 00512 m_semantics_method_p->invoke( m_semantics_host_p ); 00513 # else 00514 (m_semantics_host_p->*m_semantics_method_p)(); 00515 # endif 00516 }
friend class sc_process_handle [friend] |
sc_core::sc_cthread_process, sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。
sc_process.h の 256 行で定義されています。
friend class sc_simcontext [friend] |
sc_core::sc_cthread_process, sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。
sc_process.h の 257 行で定義されています。
friend class sc_object [friend] |
sc_process.h の 259 行で定義されています。
friend class sc_port_base [friend] |
sc_process.h の 260 行で定義されています。
friend class sc_runnable [friend] |
friend class sc_sensitive [friend] |
sc_process.h の 262 行で定義されています。
friend class sc_sensitive_pos [friend] |
sc_process.h の 263 行で定義されています。
friend class sc_sensitive_neg [friend] |
sc_process.h の 264 行で定義されています。
friend class sc_module [friend] |
sc_core::sc_cthread_process, sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。
sc_process.h の 265 行で定義されています。
friend class sc_report_handler [friend] |
sc_process.h の 266 行で定義されています。
friend class sc_reset [friend] |
sc_process.h の 267 行で定義されています。
friend class sc_reset_finder [friend] |
sc_process.h の 268 行で定義されています。
const char* sc_gen_unique_name | ( | const char * | , | |
bool | preserve_first | |||
) | [friend] |
sc_process_handle sc_get_current_process_handle | ( | ) | [friend] |
void sc_thread_cor_fn | ( | void * | arg | ) | [friend] |
sc_core::sc_thread_processで再定義されています。
void sc_cthread_cor_fn | ( | void * | arg | ) | [friend] |
sc_core::sc_cthread_process, と sc_core::sc_thread_processで再定義されています。
sc_cthread_process.cpp の 63 行で定義されています。
00064 { 00065 sc_cthread_handle cthread_h = RCAST<sc_cthread_handle>( arg ); 00066 00067 // EXECUTE THE CTHREAD AND PROCESS ANY EXCEPTIONS THAT ARE THROWN: 00068 // 00069 // We set the wait state to unknown before invoking the semantics 00070 // in case we are reset, since the wait state will not be cleared, 00071 // since that happens only if we are not reset. 00072 00073 while( true ) { 00074 00075 try { 00076 cthread_h->semantics(); 00077 } 00078 catch( sc_user ) { 00079 continue; 00080 } 00081 catch( sc_halt ) { 00082 ::std::cout << "Terminating process " 00083 << cthread_h->name() << ::std::endl; 00084 } 00085 catch( const sc_report& ex ) { 00086 ::std::cout << "\n" << ex.what() << ::std::endl; 00087 cthread_h->simcontext()->set_error(); 00088 } 00089 00090 break; 00091 } 00092 00093 // SCHEDULE THREAD FOR DESTRUCTION: 00094 // 00095 // If control reaches this point the process semantics have returned 00096 // so the process should die. 00097 00098 cthread_h->kill_process(); 00099 00100 }
bool timed_out | ( | sc_simcontext * | ) | [friend] |
const char* sc_core::sc_process_b::file |
sc_process.h の 344 行で定義されています。
sc_process.h の 345 行で定義されています。
sc_process.h の 346 行で定義されています。
std::vector<sc_object*> sc_core::sc_process_b::m_child_objects [protected] |
sc_process.h の 349 行で定義されています。
bool sc_core::sc_process_b::m_dont_init [protected] |
sc_process.h の 350 行で定義されています。
bool sc_core::sc_process_b::m_dynamic_proc [protected] |
sc_process.h の 351 行で定義されています。
const sc_event* sc_core::sc_process_b::m_event_p [protected] |
sc_process.h の 352 行で定義されています。
int sc_core::sc_process_b::m_event_count [protected] |
sc_process.h の 353 行で定義されています。
sc_event_list* sc_core::sc_process_b::m_event_list_p [protected] |
sc_process.h の 354 行で定義されています。
sc_process_b* sc_core::sc_process_b::m_exist_p [protected] |
sc_process.h の 355 行で定義されています。
bool sc_core::sc_process_b::m_free_host [protected] |
sc_process.h の 356 行で定義されています。
sc_report* sc_core::sc_process_b::m_last_report_p [protected] |
sc_process.h の 357 行で定義されています。
sc_name_gen* sc_core::sc_process_b::m_name_gen_p [protected] |
sc_process.h の 358 行で定義されています。
sc_process.h の 359 行で定義されています。
int sc_core::sc_process_b::m_references_n [protected] |
sc_process.h の 360 行で定義されています。
bool sc_core::sc_process_b::m_reset_level [protected] |
sc_process.h の 361 行で定義されています。
sc_reset* sc_core::sc_process_b::m_reset_p [protected] |
sc_process.h の 362 行で定義されています。
sc_process_b* sc_core::sc_process_b::m_runnable_p [protected] |
sc_process.h の 363 行で定義されています。
sc_process_host* sc_core::sc_process_b::m_semantics_host_p [protected] |
sc_process.h の 364 行で定義されています。
sc_process.h の 365 行で定義されています。
std::vector<const sc_event*> sc_core::sc_process_b::m_static_events [protected] |
sc_process.h の 366 行で定義されています。
sc_event* sc_core::sc_process_b::m_term_event_p [protected] |
sc_process.h の 367 行で定義されています。
sc_process.h の 368 行で定義されています。
bool sc_core::sc_process_b::m_timed_out [protected] |
sc_process.h の 369 行で定義されています。
sc_event* sc_core::sc_process_b::m_timeout_event_p [protected] |
sc_process.h の 370 行で定義されています。
trigger_t sc_core::sc_process_b::m_trigger_type [protected] |
sc_process.h の 371 行で定義されています。
bool sc_core::sc_process_b::m_zombie [protected] |
sc_process.h の 372 行で定義されています。
sc_process_b * sc_core::sc_process_b::m_delete_next_p = 0 [static, protected] |
sc_process.h の 375 行で定義されています。
sc_process_b * sc_core::sc_process_b::m_last_created_process_p = 0 [static, protected] |
sc_process.h の 376 行で定義されています。