Jump to content
Sign in to follow this  
hooman_hbi

waiting on an array of events

Recommended Posts

Hi,

 

In my design I want a to have a SC_THREAD which waites on an array of events. Now I am aware of the fact that I could OR the events with '|'. But that solution is not handy when one is dealing with a large number of events. So is there any better solution?

 

Thanks,

Hooman

Share this post


Link to post
Share on other sites

You can also just make your SC_THREAD sensitive to each element in the array, since a process sensitive to multiple events is sensitive to the or of those events, e.g.

 

SC_THREAD(proc)

for (int i=0; i< 100; i++)

   sensitive << my_array_of_100_events;

 

regards

Alan

Share this post


Link to post
Share on other sites

Is there a preferred way of adding an event to the static sensitivity list for a single wait? I think it would be possible by ORing the static sensitivity list with another event, and sending the result to a wait. The problem is that I don't see an accessor function for a thread's sensitivity list.

 

I guess one approach is to hard-code an sc_event_or_list that includes the static sensitivity list, but that seems a little clunky.

 

sc_event_or_list or_list;

for (int i=0; i< 100; i++)

   or_list |= my_array_of_100_events;

or_list |= new_event;

wait( or_list );

 

 Is there a better way to add an event to the sensitivity list for a single wait?

 

Thanks,

Patrick

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  

×