Jump to content

where am i check in code which error : port not bound?


carter

Recommended Posts

Hi, Are you using a test bench for that module? If yes check in the test-bench files where the ports are bound. Its possible that one or more of them are not bound to anything.

hi 

can i make test bench code in sc_main() ? or i have to separate sc_main  and test bench code?

As i think, the test bench code is like this .

sc_main () {

...

adder u_adder("adder")

u_adder.p_in(4);

...

 

sc_start()

sc_stop()

,,,

}

 

Error : complete binding failed : port not bound: port `adder.port_1' (sc_in)

Link to comment
Share on other sites

yes that seems to be fine, I assume that you have  written an module of adder which will be in some  adder.h file , In a new test_adder.cpp file you can do something like this

#include"adder.h"

int sc_main() int argc, char* argv[]) {

 

sc_in<bool> a_in;

sc_in<bool> b_in;

sc_in<bool> carry_in;

sc_out<bool> sum_out;

......

 

adder u_adder("adder");

u_adder.p_in(a_in);

u_adder.q_in(b_in);

...

 

sc_start()

sc_stop()

Link to comment
Share on other sites

yes that seems to be fine, I assume that you have  written an module of adder which will be in some  adder.h file , In a new test_adder.cpp file you can do something like this

#include"adder.h"

int sc_main() int argc, char* argv[]) {

 

sc_in<bool> a_in;

sc_in<bool> b_in;

sc_in<bool> carry_in;

sc_out<bool> sum_out;

......

 

adder u_adder("adder");

u_adder.p_in(a_in);

u_adder.q_in(b_in);

...

 

sc_start()

sc_stop()

should i make separate like adder header file?

Link to comment
Share on other sites

I had same doubts as you , please see this question hope it clears the doubt

http://stackoverflow.com/questions/17269378/systemc-sensitivity-list-behaviour-driving-the-pins-from-main-program

Thanks

When i change like this "digital_and1 (a_in , b_in , c_out);", anyway i can test passed.

adder u_adder("adder");

u_adder(clk1, data ,   addr );

 

 

 

but  i still have question , why i'm not have passed like following coded ?(port not bound..., no match for cal..bla~bla~)

 

adder u_adder("adder");

u_adder.p_in(clk1);

u_adder.q_in(data);

...

?

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.

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.

×
×
  • Create New...