dakupoto Posted February 18, 2013 Report Share Posted February 18, 2013 Could some SystemC guru please help ? I have in the test harness for a simple master slave JK flip-flop the following clock: sc_core::sc_clock clk("clk", 2.0, sc_core::SC_PS, 0.5); ......... sc_core::sc_start(10.0, sc_core::SC_PS); sc_core::sc_stop(); return 0; } However, the output always looks like: 0 jkmsff_0.inv_0 1 0 0 jkmsff_0.nnd3_0 0 1 0 0 jkmsff_0.nnd3_1 0 1 0 0 jkmsff_0.nnd3_1 1 1 0 0 jkmsff_0.nnd2_o2_0 1 0 0 jkmsff_0.nnd2_o2_1 1 0 0 jkmsff_0.nnd2_0 1 0 ...... ..... Where the first 0 is supposed to be a time stamp extracted as in an inverter SC_MODULE(inv) { sc_core::sc_in<bool> din; sc_core::sc_out<bool> dout; bool b0; void inv_proc0() { while(1) { wait(); b0 = din.read(); dout.write(!b0); std::cout<<sc_core::sc_time_stamp().to_seconds()<<" "<<name()<<" "<<b0<<" "<<!b0<<std::endl; } } SC_CTOR(inv):b0(false) { SC_THREAD(inv_proc0); sensitive << din; } ~inv(){} }; The results are identical as SystemC 2.3.0, 2.2.0 Is there any glaring error ? I have used similar clocks over and over in other modules, and they work just fine. Any hints, suggestions would be of immense help. Quote Link to comment Share on other sites More sharing options...
apfitch Posted February 18, 2013 Report Share Posted February 18, 2013 Don't use to_seconds(), the stream operators are overloaded for the sc_time type Alan Quote Link to comment Share on other sites More sharing options...
dakupoto Posted February 20, 2013 Author Report Share Posted February 20, 2013 I have tried your suggestion, but I am afraid it makes no difference. Quote Link to comment Share on other sites More sharing options...
apfitch Posted February 20, 2013 Report Share Posted February 20, 2013 Try writing out sc_delta_count() as well as sc_time_stamp(). If sc_delta_count() is increasing, but sc_time_stamp() stays at 0, you are stuck in a combinational feedback loop, regards Alan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.