noxim
noxim copied to clipboard
Systemc : Error: (E109) complete binding failed:
Hi everyone
I'm new in systemc ,I'm trying to design (and gate) and create vcd file for simulation
and when build project I got on this error Error: (E109) complete binding failed: port not bound: port 'and3.port_1' (sc_in) In file: ../../../src/sysc/communication/sc_port.cpp:235
My code: /////////////////////////////////////////////////////// andh2.h
#ifndef ANDH2_H_
#define ANDH2_H_
#include <systemc.h>
SC_MODULE(andh2){
sc_in
}
SC_CTOR(andh2){
SC_METHOD(and_process);
sensitive<<a<<b;
}
};
#endif /* ANDH2_H_ */
/////////////////////////////////////////////////////////////////////
and_test.cpp
#include<systemc.h> #include"andh2.h" int sc_main(int argc, char*argv[]) { andh2 and1("and1"),and2("and2"),and3("and3");
sc_signal<bool> A,B,O;
and1.a(A);
and2.b(B);
and3.o(O);
sc_start(SC_ZERO_TIME);
sc_trace_file *tf=sc_create_vcd_trace_file("trace");
tf->set_time_unit(1,SC_NS);
sc_trace(tf,A,"A");
sc_trace(tf,B,"B");
sc_trace(tf,O,"O");
A=0;B=0;
sc_start(10,SC_NS);
for(int i=0;i<10;i++){
A=((i& 0*1)!=0);
B=((i& 0*2)!=0);
sc_start(10,SC_NS);
}
sc_close_vcd_trace_file(tf);
sc_start();
return 0;
}