Jump to content

Determining source of events using global fifo

Recommended Posts

Hello All,


I have a question about determining the source of event for a module (module_a) connected to multiple modules (module_b1, module_b2, and module_b3) through sc_fifos (sf_b1_to_a, sf_b2_to_a, and sf_b3_to_a). module_a has a process that processes both clocked and non-clocked events. I use clk.posedge() to determine the source of clocked and non-clocked events. The process in module_a is made sensitive to clk.pos(), sf_b1_to_a.data_written(), sf_b2_to_a.data_written(), and sf_b3_to_a.data_written(). The problem is when the module_a process is triggered due to one of the non-clocked events (i.e., sf_b1_to_a.data_written(), sf_b2_to_a.data_written(), or sf_b3_to_a.data_written()) I don't know how to determine which one actually triggered the module_a process.


I have an idea to determine the source of the event. I'd like to validate my idea. My idea is that I use a global fifo, and when any of modules module_b1, module_b2, or module_b3 write to the corresponding sc_fifo, write its ID to the global fifo as well. Then, when module_a is triggered for a non-clocked event, I read the global fifo and determine which fifo has written to the global fifo. Is this a valid assumption that the order that modules b1, b2, and b3 write to the global fifo, the same as the order that the SystemC kernel triggers module_a for their respective data_written() events?


Thank you so much in advance!






Share this post

Link to post
Share on other sites

Hello Alireza,


How about having separate processes to read from the individual FIFOs, which are only sensitive to the clock and the respective data_written() event? Then you are sure from where the data is coming?


The order in which processes, which are sensitive to any event triggered at a specific point in time, are activated to execute is not deterministic. So you cannot do any assumptions on the activation order.


Regards, Torsten

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