mohitnegi Posted August 28, 2014 Report Share Posted August 28, 2014 hello all , i am just started to use sc_process_handler and the suspend/wait usuage is somewhat similar to wait(e) (ignoring its implementation w.r.t schedular) ... as i see that from the usuage point of view i can replace suspend/resume any where i have wait(e) ... can anyone tell me the difference here ... Quote Link to comment Share on other sites More sharing options...
dakupoto Posted August 28, 2014 Report Share Posted August 28, 2014 hello all , i am just started to use sc_process_handler and the suspend/wait usuage is somewhat similar to wait(e) (ignoring its implementation w.r.t schedular) ... as i see that from the usuage point of view i can replace suspend/resume any where i have wait(e) ... can anyone tell me the difference here ... Hello Sir, Could you please make your query a bit more concrete ? A simple example, would be helpful in understanding what exactly the main issue is. Quote Link to comment Share on other sites More sharing options...
mohitnegi Posted August 28, 2014 Author Report Share Posted August 28, 2014 Hello Sir, Could you please make your query a bit more concrete ? A simple example, would be helpful in understanding what exactly the main issue is. #include "systemc.h" class test : public sc_module { public : sc_process_handle t ; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); wait(5,SC_NS); cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); t.suspend(); wait(20,SC_NS); t.resume(); //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } vs #include "systemc.h" class test : public sc_module { public : //sc_process_handle t ; sc_event e1,e2; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); //t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); wait(5,SC_NS); e1.notify(); //here we want to suspend it wait(SC_ZERO_TIME); wait(e2); ///here it will resume cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); wait(e1); //t.suspend(); wait(20,SC_NS); e2.notify(); //t.resume(); //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } our purpose is same in both cases ...so what is the difference whether i use wait(e) or suspend/resume Quote Link to comment Share on other sites More sharing options...
David Black Posted August 28, 2014 Report Share Posted August 28, 2014 Suggest you see http://videos.accellera.org/ieee16662011/index.html 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.