davidepatti / noxim

Network on Chip Simulator
231 stars 122 forks source link

Systemc : Error: (E109) complete binding failed: #114

Closed omaimaALokap-web closed 10 months ago

omaimaALokap-web commented 4 years ago

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 ANDH2H

define ANDH2H

include

SC_MODULE(andh2){ sc_in a; sc_in b; sc_out o; void and_process(){ o.write(a.read()&&b.read());

}
SC_CTOR(andh2){
    SC_METHOD(and_process);
    sensitive<<a<<b;
}

};

endif / ANDH2H /

/////////////////////////////////////////////////////////////////////

and_test.cpp

include

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;

}

davidepatti commented 10 months ago

Not noxim related.