Jump to content
carter

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

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)

Share this post


Link to post
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()

Share this post


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

Share this post


Link to post
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);

...

?

Share this post


Link to post
Share on other sites

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);

...

?

You must have missed some ports.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×