Jump to content
Sign in to follow this  
amitk3553

use of events vs flags

Recommended Posts

To make dependency of number of things on each other I can use Events and flags.

 

Like b/w modules we should use events and in single module to make dependent processes to each other we would use flags??

 

There would be some standard for the use of events from the point of good coding style or efficiency ?

 

Please clarify this.

Thanks!!

 

 

 

 

Regards

cam

Share this post


Link to post
Share on other sites

SystemC kernel simulates parallel execution of hardware. Processes suspends and resumes. A process can suspend itself and wait for an event to take place. When the event happens, that process resumes its execution. This is the most important power of SystemC. You cannot gain this advantage using flags, even inside the same module.

Share this post


Link to post
Share on other sites

To make dependency of number of things on each other I can use Events and flags.

 

Like b/w modules we should use events and in single module to make dependent processes to each other we would use flags??

 

There would be some standard for the use of events from the point of good coding style or efficiency ?

 

Please clarify this.

Thanks!!

 

 

 

 

Regards

cam

Please use SC_THREAD with appropriate sensitivity list. That way the simulation kernel

assumes full responsibility for tracking events, i.e., exploit implicit events as much as

possible. Using sc_event/notify/wait(explicit events) transfers the burden of tracking

and acting on events to the programmer -- a difficult task with large number of modules

performing complicated operations. Flags are simply a no-no. Hope that helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×