rahuljn Posted June 30, 2014 Report Share Posted June 30, 2014 Hi Experts With the below programe, I have following error Error: (E559) Undefined process control interaction: attempt to disable a thread with timeout wait: t.func2In file: ../../../../systemc-2.3.0/src/sysc/kernel/sc_process.cpp:345In process: t.func1 @ 5 nsI am not able to figure out why ? Can you please help #include "systemc.h" class test : public sc_module { public : SC_HAS_PROCESS(test); test(sc_module_name name){ SC_THREAD(func1); func1_p = sc_get_current_process_handle(); SC_THREAD(func2); func2_p = sc_get_current_process_handle(); } sc_process_handle func1_p,func2_p; void func1(){ for(;{ wait(5,SC_NS); func2_p.disable(); wait(5,SC_NS); func2_p.enable(); } } void func2(){ for(;{ wait(10,SC_NS); cout<<sc_time_stamp().value()<<endl; } }}; int sc_main(int, char*[]){ test t("t"); sc_start(SC_ZERO_TIME); sc_start(); /*cout<<sc_time_stamp().value()<<endl; if(sc_get_status() == SC_PAUSED){sc_start(10,SC_NS);} cout<<sc_time_stamp().value()<<endl;*/ return 0;} Quote Link to comment Share on other sites More sharing options...
rahuljn Posted June 30, 2014 Author Report Share Posted June 30, 2014 Please consider the following processes instead the one I posted before void func1(){ wait(5,SC_NS); func2_p.disable(); wait(5,SC_NS); func2_p.enable(); } void func2(){ for(;{ wait(10,SC_NS); cout<<sc_time_stamp().value()<<endl; } } Quote Link to comment Share on other sites More sharing options...
rahuljn Posted June 30, 2014 Author Report Share Posted June 30, 2014 I have following two processes void func1(){ wait(5,SC_NS); func2_p.disable(); cout<<func2_p.dump_state()<<endl; wait(5,SC_NS); func2_p.enable(); cout<<func2_p.dump_state()<<endl; wait(5,SC_NS); } void func2(){ for(;{ wait(1,SC_NS); cout<<sc_time_stamp().value()<<endl; } } when I run, I get 1000200030004000[disabled ]5000[ normal] seems calling func2_p.enable(); has no effect, it is not enabling the func2. Can you please help ? Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted June 30, 2014 Report Share Posted June 30, 2014 As the original error message says, you are not supposed to disable() a process that is within a timed wait (i.e. wait(xx,SC_NS); in your case). See Section 5.6.6.2 of IEEE 1666-2011. Moreover, since your func2 process has no static sensitivity, the process will not run again after it is enabled, unless it is explicitly reset.See 5.6.6.2 again, quoting: If a time-out occurs while a process instance is disabled and that process instance is sensitive to no other events aside from the time-out itself, the process instance will not run again (unless it is reset) and the implementation may issue a warning. If you want to enable/disable a process, the target process should be sensitive to events, instead of using timed waits itself. /Philipp Quote Link to comment Share on other sites More sharing options...
rahuljn Posted June 30, 2014 Author Report Share Posted June 30, 2014 Thanks Philipp It is clear now. Thanks Again. Quote Link to comment Share on other sites More sharing options...
rahuljn Posted June 30, 2014 Author Report Share Posted June 30, 2014 Hi Philipp I tried to use explicit reset but the func2 is not running after enable void func1(){ wait(5,SC_NS); func2_p.disable(); wait(20,SC_NS); func2_p.enable(); func2_p.reset(); wait(5,SC_NS); } void func2(){ cout<<"func2 start"<<endl; for(;{ wait(1,SC_NS); cout<<sc_time_stamp().value()<<endl; } } Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted June 30, 2014 Report Share Posted June 30, 2014 I tried to use explicit reset but the func2 is not running after enable It should. You should see a second "func2 start" line. Please post a complete example. Is there a difference between SystemC 2.3.0 and 2.3.1? Which platform/what compiler (flags)? /Philipp Quote Link to comment Share on other sites More sharing options...
rahuljn Posted June 30, 2014 Author Report Share Posted June 30, 2014 Yes philipp. I am getting the second "func2 start" line. Thanks 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.