Jump to content
Gautham

sc_event not working but sc_fifo does

Recommended Posts

Hi all,

I have a project which has a many modules. In one of the modules there is a producer and a consumer. I synced them using an event.

Producer

event1.notify()

Consumer

wait(event1);

This seems to be not working.

Now I tried using sc_fifo

sc_fifo<int> notifyFifo(1)

 

Producer

notifyFifo->write(dummy);

Consumer:

dummy = notifyFifo->read()

 

This is working.

 

I also tried putting wait after signal in producer and commenting out the consumer wait

Producer

event1.notify()

wait(event1);

This also does not work. As the producer is getting stuck in wait. Verified by inserting print statements.

Did anyone face a similar issue?

 

 

Edited by Gautham
spelling mistakes

Share this post


Link to post
Share on other sites

Please note that event notification will be lost if no one is waiting for it.  This may be your case:

Option 1:  Consumer starts and suspends on wait(), Producer starts, notifies event, resumes consumer.

Option 2:  Producer starts, notifies event, event notification does nothing since no one is waiting for it.

So maybe sc_fifo is what you really need. 

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.


×
×
  • Create New...