HTP Posted April 11, 2021 Report Share Posted April 11, 2021 Hello, I am getting the error in the title when trying to connect two of my modules in my tb. related SystemC code is as below. #ifndef TB_H #define TB_H #include "systemc.h" #include <tx.h> #include <selector.h> SC_MODULE (tb) { tx mytx; selector myselector; myStruct_t ctrl_frame; sc_lv<6> temp_sig; SC_CTOR(tb) : mytx("mytx"), myselector("myselector") { mytx.i_ctrl ( ctrl_frame); mytx.o_data ( temp_sig ); myselector.out_fifo (ctrl_frame); } }; #endif Can you please let me know what is the problem? Thanks, Hadi Quote Link to comment Share on other sites More sharing options...
Eyck Posted April 11, 2021 Report Share Posted April 11, 2021 In the follwoing linemyselector.out_fifo (ctrl_frame); myselector.out_fifo (ctrl_frame); You are trying to bind ctrl_frame to the sc_fifo_in port. And obviously ctrl_frame is neither a sc_fifo nor implements the sc_fifo_in_if. Quote Link to comment Share on other sites More sharing options...
HTP Posted April 12, 2021 Author Report Share Posted April 12, 2021 Thanks for your response. out_fifo is actually sc_fifo_out as shown below. So cant we pass custom struct to sc_fifo in our out? Also looks like the issue is not limited to myselector.out_fifo, it is with both ports of mytx as well. #include "systemc.h" enum mod {BPSK, QPSK, _8PSK, _16QAM, _32QAM, _64QAM} ; typedef struct { sc_uint<15> fl_bit; sc_uint<10> in_byte; mod mod_order; } myStruct_t; SC_MODULE (selector) { sc_fifo_out <myStruct_t> out_fifo ; void random_process(); SC_CTOR(selector) { SC_METHOD(random_process); } }; Quote Link to comment Share on other sites More sharing options...
maehne Posted April 12, 2021 Report Share Posted April 12, 2021 @HTP: Your member variables ctrl_frame and temp_sig are of type myStruct_t and sc_lv<6>, respectively, which only hold data like ordinary variables. You cannot use such variables as a signal/channel. Only the latter can be bound to ports. Your sc_fifo_out<myStruct_t> out_fifo needs to be bound to a member variable of type sc_fifo<myStruct_t>. That type implement the interface used by the sc_fifo_out<myStruct_t> port and acts as a channel implementing the FIFO behaviour. You still seem to struggle with the basic concepts of SystemC. Therefore, I recommend you to read a good introduction to SystemC, e.g., David Black et a. "SystemC from the Ground Up", 2nd edition, Springer, 2009 or the SystemC tutorial by Doulos. 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.