Jump to content

sc_port<> binding


Effiong

Recommended Posts

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

 

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...