Search the Community
Showing results for tags 'data_written'.
Found 1 result
Determining source of events using global fifo
arhdr_sc posted a topic in SystemC LanguageHello 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