Jump to content

makiso

Members
  • Content count

    4
  • Joined

  • Last visited

  1. sorry ameya, I did go through the link still I am not able figure my error. I have used an equivalent logic though. I also don't understand what do you mean by " why the i index is used here what about the i+.... interfaces? ". I just don't understand why there is an port error in chol alone. I used the same logic in my testbench but I didn't get any error over there. Why specifically that port 16 alone was not able to bind when all others can?
  2. Hello ameya, Thank you for your response. I have debugged the above error but now i am facing a different problem. Error: (E109) complete binding failed: port not bound: port 'top.chol.port_16' (sc_out) In file: ../../../../src/sysc/communication/sc_port.cpp:233 Main File #include "chol.h" #include "tb_chol.h" #define SC_INCLUDE_FX SC_MODULE (systemxx) { chol *chol0; test_CHOL *test_CHOL0; sc_in_clk clk; //sc_clock clk("clk", 25, SC_NS, 0.5, 12.5, SC_NS, true); sc_signal<bool> rst; sc_signal<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_in_data[3][3]; sc_signal<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_out_data[3][3]; SC_CTOR (systemxx) { // Connect to test bench int n = 3; test_CHOL0 = new test_CHOL("test_CHOL0"); test_CHOL0->clk(clk); test_CHOL0->rst(rst); for(int i=0;i<n;i++) { for (int j=0;j<=i;j++) { test_CHOL0->chol_in_data[j](chol_in_data[j]); test_CHOL0->chol_out_data[j](chol_out_data[j]); } } // Connect to CHOL chol0 = new chol ("chol"); chol0->clk(clk); chol0->rst(rst); for(int i=0;i<n;i++) { for (int j=0;j<=i;j++) { chol0->chol_in_data[j](chol_in_data[j]); chol0->chol_out_data[j](chol_out_data[j]); } } } ~systemxx() { delete chol0; delete test_CHOL0; } }; systemxx *top = NULL; int sc_main(int argc, char** argv) { sc_clock clk("clk", 25, SC_NS, 0.5, 12.5, SC_NS, true); sc_signal<bool> rst; top = new systemxx ("top"); sc_start( 25, SC_NS ); rst.write(0); sc_start( 25, SC_NS ); rst.write(1); sc_start(); return 0; }; Could you please help me resolve this error please? Thanks in advance
  3. Hi Alan, I am getting the error as "Error: (E109) complete binding failed: port not bound: port 'top.chol.port_16' (sc_out)" I have attached my files below. Please help me resolve the error chol.h cholesky.cpp main.cpp tb_chol.cpp tb_chol.h
  4. // Below is my chol.h header file #ifndef CHOL #define CHOL #define SC_INCLUDE_FX //#include "sc_module.h" #include "define.h" SC_MODULE (chol) { public: // Inputs sc_in_clk clk; sc_in<bool> rst; sc_in<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_in_data[3][3] ; // Output sc_out<sc_fixed<16,10, SC_TRN, SC_WRAP> > chol_out_data[3][3] ; /* F */ void chol_main ( void ); //sc_fixed<32,16, SC_TRN, SC_WRAP> cholesky(sc_fixed<32,16, SC_TRN, SC_WRAP> *); // Constructor SC_CTOR (chol) { SC_CTHREAD (chol_main, clk.pos() ); reset_signal_is(rst, false) ; sensitive << clk.pos(); } // Destructor ~chol() {} }; #endif /// Below is my cholesky.cpp file #include "chol.h" #include <math.h> //Main Thread void chol::chol_main () { // Variable declaration sc_fixed<16,10, SC_TRN, SC_WRAP> chol_output[3][3]; sc_fixed<16,10, SC_TRN, SC_WRAP> chol_in[3][3]; int n=3; // Reset cycle// //chol_output.write(0); //wait(); //Main Thread while (true) { for (int i=0; i<n; i++) { for(int j=0; j<=i; j++) { chol_in[j] = chol_in_data[j].read(); } } } for (int i=0; i<n; i++) { for (int j=0; j<=i; j++) { sc_fixed<16,10, SC_TRN, SC_WRAP> sum = 0; for (int k=0; k<j; k++) { sum += chol_output[k] * chol_output[j][k]; } if (i==j) { chol_output = sqrt(chol_in - sum) ; } else { chol_ouput[j] = 1.0 / chol_ouput[j][j] * (chol_in[j] - sum); } } } // Cholesky Function //chol_output = cholesky (chol_in); chol_out_data.write(chol_output); } when i try to compile this file i get the follwoing errors. output: g++ -O1 -I"/home/mahesh/systemc/systemc-2.3.1a/include" -I"." -c cholesky.cpp -o cholesky.o cholesky.cpp: In member function ‘void chol::chol_main()’: cholesky.cpp:46:5: error: ‘chol_ouput’ was not declared in this scope chol_ouput[j] = 1.0 / chol_ouput[j][j] * (chol_in[j] - sum); ^ cholesky.cpp:53:17: error: request for member ‘write’ in ‘((chol*)this)->chol::chol_out_data’, which is of non-class type ‘sc_core::sc_out<sc_dt::sc_fixed<16, 10, (sc_dt::sc_q_mode)5u, (sc_dt::sc_o_mode)3u> > [3][3]’ chol_out_data.write(chol_output); ^ Makefile:90: recipe for target 'cholesky.o' failed make: *** [cholesky.o] Error 1 It would be very helpful if someone could resolve this error for me. I tried working on alternatives but I am not able to handle my issue. Thanks in advance.
×