Effiong Posted September 25, 2015 Report Share Posted September 25, 2015 Hi all, I created two modules with interfaces as below: M1 : sc_port<sc_fifo_out_if<T>, 0> a M2 : sc_port<sc_fifo_in_if<T>, 0> a2; I have a third module which is also my top module i.e M3 and tried binding M1 output to M2 input to create a communication channel. I have tried using sc_fifo<T> but it doesn't work. How do I bind M1 output to M2 input inside M3 module? Please not that T is a struct. Thanks Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted September 25, 2015 Report Share Posted September 25, 2015 Hi. Normally, what you tried is correct. You should be able to bind the fifo to the two ports. Maybe you can try again with int as T. If this works, you should check if the rules for T as stated in Section 6.23.3 of the SystemC LRM are fulfilled for your struct. Greetings Ralph Quote Link to comment Share on other sites More sharing options...
dakupoto Posted September 27, 2015 Report Share Posted September 27, 2015 Hi all, I created two modules with interfaces as below: M1 : sc_port<sc_fifo_out_if<T>, 0> a M2 : sc_port<sc_fifo_in_if<T>, 0> a2; I have a third module which is also my top module i.e M3 and tried binding M1 output to M2 input to create a communication channel. I have tried using sc_fifo<T> but it doesn't work. How do I bind M1 output to M2 input inside M3 module? Please not that T is a struct. Thanks Hello Sir, I am afraid as SystemC at its core is a C++ library, all the T can only be a primitive data type supported by the core C++ language. To achieve your goal of fransferring a struct between modules, you would have to create/ use a custom signal channel defined by you. This is achieved simply by creating a buffer to hold the struct, and a blocking read/write scheme(using the built-in SystemC sc_mutex, sc_semaphore etc.,) to ensure that the empty buffer cannot be read, and no writes are possible during a read operation. Hope that helps. 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.