Jump to content
Sign in to follow this  
Jenkki_Menthol

Communication between multiple modules

Recommended Posts

My design includes communication between 5 different modules. Let's say the modules are 1, 2, 3, 4 and 5.

The communication takes place between modules 4 and 5 first, they exchange four messages between them but once that is done communication should take place between 4 and 1, then 5 and 1. Once that is done, then 4 and 2, then 5 and 2. And similarly 4 and 3, then 5 and 3. When I started writing the design between 4 and 5 using cthreads and wait(), that worked fine. But once that is done, I can't seem to start the communication between modules 4 and 1. I guess I still didn't wholly understand the concept of processes and wait(), but could someone suggest how to go about this?

module4.h                                                                                            module5.h

//input and output ports are defined                                              //input and output ports are defined

//sc_cthread(func4, clk.pos())                                                        //sc_cthread(func5, clk.pos())

module4.cpp                                                                                     module5.cpp

//void module4::func4                                                                     //void module5::func5

//while(true)                                                                                     //while(true)

//send message1; wait();                                                             //receive message1; send message2; wait();

//receive message2; send message3; wait();                           //receive message3; send message4; wait();

//receive message4; wait();

It was working fine when I just had only these two modules at first. I wrote a value to the signal which connects module4 and module5 from the main function and these two started communicating just the way I wanted.

Then, module1.h was defined.

//input and output ports are defined

//sc_cthread(func1, clk.pos())                                             module4.cpp

module1.cpp                                                                          //send message5; wait();

//receive message5(); wait();

But when I defined module1 just the way I defined modules4 and 5, the communication stopped after sending message1 in module4. Module5 didn't seem to receive message1. Can someone point out how to go about this? I know I probably am not using wait() statements the way they are meant to be used, so any help will be much appreciated. Thanks!

Share this post


Link to post
Share on other sites

Hello @Jenkki_Menthol,

The provided pseudo code and the description is not clear enough to provide any useful suggestions.

Can you elaborate more on the exact problem statement probably with some very generic code to help you with some suggestions further?

Regards,

Ameya Vikram Singh

Share this post


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

Sign in to follow this  

×
×
  • Create New...