swarnava9 Posted September 14, 2015 Report Share Posted September 14, 2015 Hi, I'm trying to implement a FIR Filter with a series of FIR node and the data_in of every fir node is connected to the data_out of the next fir node and the last data_out is connected to the data_in of the accumulator.I've implemented the code but during runtime it's giving an error "(E109) complete binding failed: port not bound: port 'FIR_NOD[10].port_2' (sc_out)".I'm attaching the code with this message.It seems to me that I have connected the ports correctly. Please helpint sc_main(int argc, char* argv[]) {int i;char nodeName[19];//signals to connect data and mul portssc_signal data_sig[NUM_TAP + 1];sc_signal mul_sig[NUM_TAP];sc_signal result;//system clocksc_clock* sys_clock;//pointer for modulesMemory* mem;FirNode * firnodes[NUM_TAP];Accumulator* accu;// create global clocksys_clock = new sc_clock("SYSTEM_CLOCK", 1, SC_NS);//Construct Memory and Accumulator modulesmem = new Memory("MEMORY");accu = new Accumulator("ACCUMULATOR");//Construct FirNodes (assign coefficient to each node)for (i = 0; i < NUM_TAP; i++) {sprintf(nodeName, "FIR_NOD[%d]", i);firnodes = new FirNode(nodeName, COEFF);}//connect ports of memorymem->data_read(data_sig[0]);mem->clock(*sys_clock);mem->data_write(result);// connect ports of fir_nodes//firnodes[0]->data_in(data_sig[0]);for(i = 0; i< NUM_TAP - 1; i++){firnodes->clock(*sys_clock);}for(i = 0; i< NUM_TAP - 1; i++){firnodes[0]->data_in(data_sig);firnodes[i+1]->data_in(firnodes->data_out);firnodes->mul_out(mul_sig);if(i == 10){firnodes[i + 1]->data_out(data_sig[12]);}}firnodes[NUM_TAP - 1]->mul_out(mul_sig[NUM_TAP - 1]);// connect ports of accumulatoraccu->data_in(firnodes[NUM_TAP - 1]->data_out);accu->clock(*sys_clock);for(i=0; i< NUM_TAP; i++){accu->mul_in(mul_sig);}accu->data_out(result);//start simulationsc_start(300, SC_NS);return 0;}v Quote Link to comment Share on other sites More sharing options...
apfitch Posted September 14, 2015 Report Share Posted September 14, 2015 It's hard to tell without knowing the value of NUM_TAP. But if NUM_TAP is 10, then if (i == 10) inside your for loop will never execute. Perhaps you should say if (i == NUM_TAP -1) ? Alan 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.