sc_delta_count.cpp revision 12855
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(method) 812855Sgabeblack@google.com sensitive << m_flipper; 912855Sgabeblack@google.com SC_THREAD(thread) 1012855Sgabeblack@google.com } 1112855Sgabeblack@google.com void method() 1212855Sgabeblack@google.com { 1312855Sgabeblack@google.com } 1412855Sgabeblack@google.com void thread() 1512855Sgabeblack@google.com { 1612855Sgabeblack@google.com m_flipper = !m_flipper; 1712855Sgabeblack@google.com wait(2, SC_NS); 1812855Sgabeblack@google.com cout << sc_delta_count() << endl; 1912855Sgabeblack@google.com m_flipper = !m_flipper; 2012855Sgabeblack@google.com wait(3, SC_NS); 2112855Sgabeblack@google.com cout << sc_delta_count() << endl; 2212855Sgabeblack@google.com sc_stop(); 2312855Sgabeblack@google.com } 2412855Sgabeblack@google.com sc_signal<bool> m_flipper; 2512855Sgabeblack@google.com}; 2612855Sgabeblack@google.com 2712855Sgabeblack@google.comint sc_main(int argc, char* argv[]) 2812855Sgabeblack@google.com{ 2912855Sgabeblack@google.com TB tb("tb"); 3012855Sgabeblack@google.com sc_start(); 3112855Sgabeblack@google.com cout << "Program completed after " << sc_time_stamp() << endl; 3212855Sgabeblack@google.com return 0; 3312855Sgabeblack@google.com} 34