carter Posted April 20, 2014 Report Share Posted April 20, 2014 Hi. If port not bound code error happened, where am i check in this code which error : port not bound? so confused. Quote Link to comment Share on other sites More sharing options...
kartikkg Posted April 20, 2014 Report Share Posted April 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
carter Posted April 20, 2014 Author Report Share Posted April 20, 2014 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) Quote Link to comment Share on other sites More sharing options...
kartikkg Posted April 20, 2014 Report Share Posted April 20, 2014 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() Quote Link to comment Share on other sites More sharing options...
carter Posted April 20, 2014 Author Report Share Posted April 20, 2014 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? Quote Link to comment Share on other sites More sharing options...
kartikkg Posted April 20, 2014 Report Share Posted April 20, 2014 No need for separate header file. Quote Link to comment Share on other sites More sharing options...
carter Posted April 20, 2014 Author Report Share Posted April 20, 2014 No need for separate header file. Thanks but i'm not sure your answer. Is this right about should i use another module for test? Quote Link to comment Share on other sites More sharing options...
kartikkg Posted April 20, 2014 Report Share Posted April 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
carter Posted April 20, 2014 Author Report Share Posted April 20, 2014 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); ... ? Quote Link to comment Share on other sites More sharing options...
kartikkg Posted April 21, 2014 Report Share Posted April 21, 2014 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. Quote Link to comment Share on other sites More sharing options...
carter Posted April 21, 2014 Author Report Share Posted April 21, 2014 You must have missed some ports.Thank youbut it's already solved. 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.