Gautham Posted September 6, 2019 Report Share Posted September 6, 2019 (edited) 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 September 6, 2019 by Gautham spelling mistakes Quote Link to comment Share on other sites More sharing options...
Eyck Posted September 6, 2019 Report Share Posted September 6, 2019 Without further context it is hard to give a helpful answer. You can try to do event1.notify(SC_ZERO_TIME) Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted September 7, 2019 Report Share Posted September 7, 2019 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. Quote Link to comment Share on other sites More sharing options...
Gautham Posted September 9, 2019 Author Report Share Posted September 9, 2019 The notification was getting lost. Thanks for the reply. 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.