Jump to content

port concatenation during instantiation inside constructor


Recommended Posts



I have three modules A,B and C. I want to integrate these three modules inside TOP module constructor.


Now module A has one port sc_out<<sc_uint<2> > out;

       module B has one port sc_out<<sc_uint<2> > out;

       module C has one port sc_in<<sc_uint<4> > in;


Now inside TOP constructor I have instantiated all these three modules A,B and C. And during connection I am doing following-








out1 and out2 both are sc_signal<sc_uint<2> > ;


This is throwing error that concatenation at ports not possible. Is it I am doing something wrong? How to perform these port concatenation directly inside constructor without introducing separate SC_METHOD for that?




Link to comment
Share on other sites

You can't concatenate ports like that - the concatenation operator is not defined for ports, it's defined for data types such as sc_uint, sc_bv, sc_lv.


The best solution is probably (as you hint) to introduce a separate SC_METHOD.


If you don't want to use a separate SC_METHOD, you might be able to do what you want using sc_vector - good luck!



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

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.

  • Create New...