SystemC 2.3:Process Handles
SystemC 2.3で色々拡張?変更されたので、
勉強がてら書いていきたいと思います。
先ずは、正常動作というか何も変更を加えてない状態です。
ここでは、t に対しての属性を表示させています。
- サンプルコード
#include <stdio.h> #include <systemc.h> SC_MODULE( hoge ){ sc_process_handle t; SC_CTOR( hoge ) { SC_THREAD( calling ); SC_THREAD( target ); t = sc_get_current_process_handle(); } void calling(){ assert( t.valid() ); cout << t.name() ; cout << t.proc_kind() << endl; } void target(){ while (1) { wait(100, SC_NS); cout << sc_time_stamp() << endl; } } }; int sc_main(int argc, char *argv[]) { hoge mhoge("hoge"); sc_start(500, sc_core::SC_NS); return 0; }
- 実行結果
$> ./main SystemC 2.3.0-ASI --- Dec 14 2012 21:01:01 Copyright (c) 1996-2012 by all Contributors, ALL RIGHTS RESERVED hoge.target2 100 ns 200 ns 300 ns 400 ns