112855Sgabeblack@google.com#include "systemc.h" 212855Sgabeblack@google.com 312855Sgabeblack@google.comSC_MODULE(TB) 412855Sgabeblack@google.com{ 512855Sgabeblack@google.com SC_CTOR(TB) 612855Sgabeblack@google.com { 712855Sgabeblack@google.com SC_METHOD(sync); 812855Sgabeblack@google.com sensitive << m_clk.pos(); 912855Sgabeblack@google.com SC_METHOD(sync); 1012855Sgabeblack@google.com sensitive << m_clk.pos(); 1112855Sgabeblack@google.com } 1212855Sgabeblack@google.com void sync() 1312855Sgabeblack@google.com { 1412855Sgabeblack@google.com sc_curr_proc_handle cpi = 1512855Sgabeblack@google.com sc_get_curr_simcontext()->get_curr_proc_info(); 1612855Sgabeblack@google.com cout << sc_time_stamp() << ": " << cpi->process_handle->name() << endl; 1712855Sgabeblack@google.com } 1812855Sgabeblack@google.com sc_in_clk m_clk; 1912855Sgabeblack@google.com}; 2012855Sgabeblack@google.com 2112855Sgabeblack@google.comint sc_main(int argc,char **argv) 2212855Sgabeblack@google.com{ 2312855Sgabeblack@google.com sc_clock clock; 2412855Sgabeblack@google.com TB tb("tb"); 2512855Sgabeblack@google.com 2612855Sgabeblack@google.com tb.m_clk(clock); 2712855Sgabeblack@google.com sc_start(2, SC_NS); 2812855Sgabeblack@google.com 2913158Sgabeblack@google.com cout << "Program completed" << endl; 3012855Sgabeblack@google.com return (0); 3112855Sgabeblack@google.com} 32