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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...