DS1701 Posted May 30, 2019 Report Share Posted May 30, 2019 Hi all, I try code bellow SC_METHOD(APMMethod); sensitive << mAPMEvent; ... void APMMethod(){ printf("Reset port\n"); ... } ... void Initialize() { for(unsigned int i=0; i< 50; i++){ mAPM_reg[i].value = 0; printf("Initialize %s\n",mAPM_reg[i].name); } } ... void EnableReset(){ //reset port mAPMEvent.notify(SC_ZERO_TIME); //initialize reg Initialize(); } When EnableReset occur. My output is: Intialize APM_REG1 Intialize APM_REG2 ... Reset port I try with mAPMEvent.notify(); But the same output. 1. why Initialize() call before APMMethod(). 2. when to use notiffy() or notify(SC_ZERO_TIME)? Thanks all. Quote Link to comment Share on other sites More sharing options...
David Black Posted May 30, 2019 Report Share Posted May 30, 2019 Notify (either case) is non-blocking, so your call to notify followed by initialize will happen. Then after you return, the notified element(s) may execute. Notify() implies execution will be in the same delta-cycle; whereas, notify(SC_ZERO_TIME) postpones to the next one and allows other processes in the current delta-cycle to complete. Take a look at <https://github.com/dcblack/SystemC-Engine/blob/master/Engine_v2.4.pdf>. DS1701 1 Quote Link to comment Share on other sites More sharing options...
DS1701 Posted May 31, 2019 Author Report Share Posted May 31, 2019 12 hours ago, David Black said: Notify (either case) is non-blocking, so your call to notify followed by initialize will happen. Then after you return, the notified element(s) may execute. Notify() implies execution will be in the same delta-cycle; whereas, notify(SC_ZERO_TIME) postpones to the next one and allows other processes in the current delta-cycle to complete. Take a look at <https://github.com/dcblack/SystemC-Engine/blob/master/Engine_v2.4.pdf>. Thank you so much, @David Black 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.