Jump to content

Determining source of events using global fifo


arhdr_sc

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!

 

Regards,

 

Alireza

 

Link to comment
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

Link to comment
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...