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_THREAD(exec); 812855Sgabeblack@google.com sensitive << m_clk.pos(); 912855Sgabeblack@google.com } 1012855Sgabeblack@google.com void exec() 1112855Sgabeblack@google.com { 1212855Sgabeblack@google.com for (;;) 1312855Sgabeblack@google.com { 1412855Sgabeblack@google.com wait(2); 1512855Sgabeblack@google.com cout << sc_time_stamp() << endl; 1612855Sgabeblack@google.com wait(4); 1712855Sgabeblack@google.com cout << sc_time_stamp() << endl; 1812855Sgabeblack@google.com wait(1); 1912855Sgabeblack@google.com cout << sc_time_stamp() << endl; 2012855Sgabeblack@google.com wait(1000); 2112855Sgabeblack@google.com cout << sc_time_stamp() << endl; 2212855Sgabeblack@google.com sc_stop(); 2312855Sgabeblack@google.com } 2412855Sgabeblack@google.com } 2512855Sgabeblack@google.com sc_in_clk m_clk; 2612855Sgabeblack@google.com}; 2712855Sgabeblack@google.com 2812855Sgabeblack@google.comint sc_main( int, char*[] ) 2912855Sgabeblack@google.com{ 3012855Sgabeblack@google.com sc_clock clock; 3112855Sgabeblack@google.com TB tb("tb"); 3212855Sgabeblack@google.com 3312855Sgabeblack@google.com tb.m_clk(clock); 3412855Sgabeblack@google.com sc_start(2000, SC_NS); 3512855Sgabeblack@google.com 3612855Sgabeblack@google.com return 0; 3712855Sgabeblack@google.com} 38