diff options
Diffstat (limited to 'src/systemc/tests/systemc/kernel/sc_process_b/test02/test02.cpp')
-rw-r--r-- | src/systemc/tests/systemc/kernel/sc_process_b/test02/test02.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/kernel/sc_process_b/test02/test02.cpp b/src/systemc/tests/systemc/kernel/sc_process_b/test02/test02.cpp new file mode 100644 index 000000000..1da5cefd1 --- /dev/null +++ b/src/systemc/tests/systemc/kernel/sc_process_b/test02/test02.cpp @@ -0,0 +1,31 @@ +#include "systemc.h" + +SC_MODULE(TB) +{ + SC_CTOR(TB) + { + SC_METHOD(sync); + sensitive << m_clk.pos(); + SC_METHOD(sync); + sensitive << m_clk.pos(); + } + void sync() + { + sc_curr_proc_handle cpi = + sc_get_curr_simcontext()->get_curr_proc_info(); + cout << sc_time_stamp() << ": " << cpi->process_handle->name() << endl; + } + sc_in_clk m_clk; +}; + +int sc_main(int argc,char **argv) +{ + sc_clock clock; + TB tb("tb"); + + tb.m_clk(clock); + sc_start(2, SC_NS); + + cerr << "Program completed" << endl; + return (0); +} |