|
Post by gchopra on May 2, 2013 8:07:05 GMT
Hello Mukesh, When we use wait() in the thread process that make process to alive and next time execute as per static sensitivity list. Use of wait (wait(), wait(10, SC_NS), wait(e)) provide us dynamic sensitivity. More on that point in test-bench we define thread without using wait() that means thread process in test-bench have static sensitivity. Gagan if we used only one wait() function in a thread like it is shown in code below what is the sensitivity static or dynamic ?? void P_THREAD() { while(true) { --do your work-- wait(); } } Hello Mukesh, It will be dynamic sensitivity.
|
|
|
Post by Mukesh on May 2, 2013 8:21:44 GMT
Gagan if we used only one wait() function in a thread like it is shown in code below what is the sensitivity static or dynamic ?? void P_THREAD() { while(true) { --do your work-- wait(); } } Hello Mukesh, It will be dynamic sensitivity. gagan i think it is static sensitivity because the thread trigger again only at the sensitivity that is define in constructor. if we pass a event in the wait then it is dynamic sensitivity !!
|
|
|
Post by gchopra on May 2, 2013 10:15:42 GMT
|
|
|
Post by gchopra on May 2, 2013 10:17:39 GMT
Hello Mukesh, Please refer SystemC LRM Page number: 88/428/
|
|
|
Post by karandeep963 on May 2, 2013 11:38:24 GMT
Hello Amitk3553, I'm saying use of wait() make process to have dynamic sensitivity. SC_MODULE(mod) { sc_in<bool> clk; sc_event e, f; void proc1() { wait(f); //static sensitivity e.notify(); } void proc2() { while(1) { f.notify(); wait(e); //wait for event (dynamic) //do something wait(1,SC_NS); //wait for time (dynamic) //do something } SC_CTOR(mod) { SC_METHOD(proc1); sensitive << clk.pos() << f; //static sensitivity SC_THREAD(proc2); //no static sensitivity, runs during initialization until 1st wait reached } }; In above example tell me process(proc1) is dynamic or sensitive.... According to me its static
|
|
|
Post by karandeep963 on May 2, 2013 11:43:11 GMT
Dear Mukesh,
Don't consider the sensitivity wait dependent.
Simple logic is that if the process is sensitive to any thing which is not mentioned in the static sensitivity list (mentioned below the constructor) is dynamic else static.
Good luck..........
|
|
|
Post by amitk3553 on May 3, 2013 5:37:21 GMT
Dear Mukesh, Don't consider the sensitivity wait dependent. Simple logic is that if the process is sensitive to any thing which is not mentioned in the static sensitivity list (mentioned below the constructor) is dynamic else static. Good luck.......... Karan's response seems to be right.But there is one more point: wait(): is used in case of sc_thread only next_trigger() : is used in case of sc_method only Because if we use wait() in method then it would be illegal to insert delay in methods. And there is also some particular reason behind the use of next_trigger() in methods only not in threads Regards Amit Kumar
|
|
|
Post by Mukesh on May 3, 2013 5:55:39 GMT
Dear Mukesh, Don't consider the sensitivity wait dependent. Simple logic is that if the process is sensitive to any thing which is not mentioned in the static sensitivity list (mentioned below the constructor) is dynamic else static. Good luck.......... Hello Karandeep Can you please post a example here in which dynamic sensitivity is implemented in a Thread without wait(). so i can understand it properly thanks
|
|
|
Post by amitk3553 on May 3, 2013 6:18:35 GMT
Dear Mukesh, Don't consider the sensitivity wait dependent. Simple logic is that if the process is sensitive to any thing which is not mentioned in the static sensitivity list (mentioned below the constructor) is dynamic else static. Good luck.......... Hello Karandeep Can you please post a example here in which dynamic sensitivity is implemented in a Thread without wait(). so i can understand it properly thanks The meaning of "Don't consider the sensitivity wait dependent." is that if you are using wait(event_e) in thread and you had given that in sensitivity like given below,then process is having static sensivity .It does not mean that thread is without wait(). Process A(){ int a; wait(event_e);//static sensitivity int c; } sc_CTOR(){ sc_thread(process_A) sensitivity<<event_e; } Regards Amit
|
|
|
Post by Mukesh on May 3, 2013 6:42:22 GMT
Hello Karandeep Can you please post a example here in which dynamic sensitivity is implemented in a Thread without wait(). so i can understand it properly thanks The meaning of "Don't consider the sensitivity wait dependent." is that if you are using wait(event_e) in thread and you had given that in sensitivity like given below,then process is having static sensivity .It does not mean that thread is without wait(). Process A(){ int a; wait(event_e);//static sensitivity int c; } sc_CTOR(){ sc_thread(process_A) sensitivity<<event_e; } Regards Amit Yes it is because you declared that sensitivity in the constructor that's y it is static sensitivity !!
|
|