クラス sc_core::sc_process_b

#include <sc_process.h>

sc_core::sc_process_bに対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public 型

enum  process_throw_type { THROW_NONE = 0, THROW_RESET }
enum  trigger_t {
  STATIC, EVENT, OR_LIST, AND_LIST,
  TIMEOUT, EVENT_TIMEOUT, OR_LIST_TIMEOUT, AND_LIST_TIMEOUT
}

Public メソッド

 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)
virtual ~sc_process_b ()
bool dont_initialize () const
virtual void dont_initialize (bool dont)
const ::std::vector< sc_object * > & get_child_objects () const
sc_curr_proc_kind proc_kind () const
sc_eventterminated_event ()

Static Public メソッド

static sc_process_handle last_created_process_handle ()

Public 変数

const char * file
int lineno
int proc_id

Protected メソッド

void add_static_event (const sc_event &)
bool dynamic () const
const char * gen_unique_name (const char *basename_, bool preserve_first)
sc_reportget_last_report ()
bool is_runnable ()
void set_last_report (sc_report *last_p)
void remove_static_events ()
bool trigger_static ()
bool timed_out () const
virtual void kill_process ()
void reset_changed ()
virtual bool terminated () const
void semantics ()

Static Protected メソッド

static sc_process_blast_created_process_base ()

Protected 変数

std::vector< sc_object * > m_child_objects
bool m_dont_init
bool m_dynamic_proc
const sc_eventm_event_p
int m_event_count
sc_event_listm_event_list_p
sc_process_bm_exist_p
bool m_free_host
sc_reportm_last_report_p
sc_name_genm_name_gen_p
sc_curr_proc_kind m_process_kind
int m_references_n
bool m_reset_level
sc_resetm_reset_p
sc_process_bm_runnable_p
sc_process_hostm_semantics_host_p
SC_ENTRY_FUNC m_semantics_method_p
std::vector< const sc_event * > m_static_events
sc_eventm_term_event_p
process_throw_type m_throw_type
bool m_timed_out
sc_eventm_timeout_event_p
trigger_t m_trigger_type
bool m_zombie

Static Protected 変数

static sc_process_bm_delete_next_p = 0
static sc_process_bm_last_created_process_p = 0

Private メソッド

void add_child_object (sc_object *)
void remove_child_object (sc_object *)
void reference_decrement ()
void reference_increment ()

フレンド

class sc_process_handle
class sc_simcontext
class sc_object
class sc_port_base
class sc_runnable
class sc_sensitive
class sc_sensitive_pos
class sc_sensitive_neg
class sc_module
class sc_report_handler
class sc_reset
class sc_reset_finder
const char * sc_gen_unique_name (const char *, bool preserve_first)
sc_process_handle sc_get_current_process_handle ()
void sc_thread_cor_fn (void *arg)
void sc_cthread_cor_fn (void *arg)
bool timed_out (sc_simcontext *)


説明

sc_process.h255 行で定義されています。


列挙型

列挙型の値:
THROW_NONE 
THROW_RESET 

sc_process.h276 行で定義されています。

00276                             {
00277         THROW_NONE = 0,
00278         THROW_RESET
00279     };

列挙型の値:
STATIC 
EVENT 
OR_LIST 
AND_LIST 
TIMEOUT 
EVENT_TIMEOUT 
OR_LIST_TIMEOUT 
AND_LIST_TIMEOUT 

sc_process.h280 行で定義されています。

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.cpp257 行で定義されています。

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.cpp296 行で定義されています。

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]

sc_process.h299 行で定義されています。

00299 { return m_dont_init; }

void sc_core::sc_process_b::dont_initialize ( bool  dont  )  [virtual]

sc_core::sc_cthread_processで再定義されています。

sc_process.cpp131 行で定義されています。

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.h409 行で定義されています。

00410 {
00411     return m_child_objects;
00412 }

sc_curr_proc_kind sc_core::sc_process_b::proc_kind (  )  const [inline]

sc_process.h445 行で定義されています。

00446 {
00447     return m_process_kind;
00448 }

sc_event & sc_core::sc_process_b::terminated_event (  ) 

sc_process.cpp334 行で定義されています。

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.h275 行で定義されています。

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.cpp88 行で定義されています。

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]

sc_process.h310 行で定義されています。

00310 { return m_dynamic_proc; }

const char * sc_core::sc_process_b::gen_unique_name ( const char *  basename_,
bool  preserve_first 
) [protected]

sc_process.cpp142 行で定義されています。

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]

sc_process.h312 行で定義されています。

00312 { return m_last_report_p; }

bool sc_core::sc_process_b::is_runnable (  )  [inline, protected]

sc_process.h421 行で定義されています。

00422 {
00423     return m_runnable_p != 0;
00424 }

sc_process_b * sc_core::sc_process_b::last_created_process_base (  )  [inline, static, protected]

sc_process.h433 行で定義されています。

00434 {
00435     return m_last_created_process_p;
00436 }

void sc_core::sc_process_b::set_last_report ( sc_report last_p  )  [inline, protected]

sc_process.h315 行で定義されています。

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.cpp221 行で定義されています。

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.h551 行で定義されています。

00552 {
00553     return ( !is_runnable() && m_trigger_type == STATIC );
00554 }

bool sc_core::sc_process_b::timed_out (  )  const [inline, protected]

sc_process.h535 行で定義されています。

00536 {
00537     return m_timed_out;
00538 }

void sc_core::sc_process_b::add_child_object ( sc_object object_  )  [inline, private]

sc_process.h388 行で定義されています。

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.h395 行で定義されています。

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.cpp157 行で定義されています。

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.h492 行で定義されています。

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]

sc_process.h524 行で定義されています。

00525 {
00526     return m_zombie;
00527 }

void sc_core::sc_process_b::reference_decrement (  )  [inline, private]

sc_process.h461 行で定義されています。

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.h479 行で定義されています。

00480 {
00481     assert(m_references_n != 0);
00482     m_references_n++;
00483 }

void sc_core::sc_process_b::semantics (  )  [inline, protected]

sc_process.h506 行で定義されています。

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.h256 行で定義されています。

friend class sc_simcontext [friend]

sc_core::sc_cthread_process, sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。

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

friend class sc_object [friend]

sc_process.h259 行で定義されています。

friend class sc_port_base [friend]

sc_process.h260 行で定義されています。

friend class sc_runnable [friend]

sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。

sc_process.h261 行で定義されています。

friend class sc_sensitive [friend]

sc_process.h262 行で定義されています。

friend class sc_sensitive_pos [friend]

sc_process.h263 行で定義されています。

friend class sc_sensitive_neg [friend]

sc_process.h264 行で定義されています。

friend class sc_module [friend]

sc_core::sc_cthread_process, sc_core::sc_method_process, と sc_core::sc_thread_processで再定義されています。

sc_process.h265 行で定義されています。

friend class sc_report_handler [friend]

sc_process.h266 行で定義されています。

friend class sc_reset [friend]

sc_process.h267 行で定義されています。

friend class sc_reset_finder [friend]

sc_process.h268 行で定義されています。

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.cpp63 行で定義されています。

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]


変数

sc_process.h344 行で定義されています。

sc_process.h345 行で定義されています。

sc_process.h346 行で定義されています。

sc_process.h349 行で定義されています。

sc_process.h350 行で定義されています。

sc_process.h351 行で定義されています。

sc_process.h352 行で定義されています。

sc_process.h353 行で定義されています。

sc_process.h354 行で定義されています。

sc_process.h355 行で定義されています。

sc_process.h356 行で定義されています。

sc_process.h357 行で定義されています。

sc_process.h358 行で定義されています。

sc_process.h359 行で定義されています。

sc_process.h360 行で定義されています。

sc_process.h361 行で定義されています。

sc_process.h362 行で定義されています。

sc_process.h363 行で定義されています。

sc_process.h364 行で定義されています。

sc_process.h365 行で定義されています。

std::vector<const sc_event*> sc_core::sc_process_b::m_static_events [protected]

sc_process.h366 行で定義されています。

sc_process.h367 行で定義されています。

sc_process.h368 行で定義されています。

sc_process.h369 行で定義されています。

sc_process.h370 行で定義されています。

sc_process.h371 行で定義されています。

sc_process.h372 行で定義されています。

sc_process.h375 行で定義されています。

sc_process.h376 行で定義されています。


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

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