112855Sgabeblack@google.com#include "systemc.h" 212855Sgabeblack@google.com 312855Sgabeblack@google.comSC_MODULE(X) 412855Sgabeblack@google.com{ 512855Sgabeblack@google.com SC_CTOR(X) 612855Sgabeblack@google.com { 712855Sgabeblack@google.com SC_THREAD(able); 812855Sgabeblack@google.com sensitive << clk.pos(); 912855Sgabeblack@google.com } 1012855Sgabeblack@google.com 1112855Sgabeblack@google.com void able() 1212855Sgabeblack@google.com { 1312855Sgabeblack@google.com for (;;) 1412855Sgabeblack@google.com { 1512855Sgabeblack@google.com wait(); 1612855Sgabeblack@google.com sensitive << clk.posedge_event(); 1712855Sgabeblack@google.com cout << "able: " << sc_time_stamp() << endl; 1812855Sgabeblack@google.com } 1912855Sgabeblack@google.com } 2012855Sgabeblack@google.com sc_in_clk clk; 2112855Sgabeblack@google.com}; 2212855Sgabeblack@google.com 2312855Sgabeblack@google.comint sc_main(int argc, char* argv[]) 2412855Sgabeblack@google.com{ 2512855Sgabeblack@google.com sc_clock clock; 2612855Sgabeblack@google.com X x("x"); 2712855Sgabeblack@google.com x.clk(clock); 2812855Sgabeblack@google.com 2912855Sgabeblack@google.com sc_start(100, SC_NS); 3012855Sgabeblack@google.com return 0; 3112855Sgabeblack@google.com} 32