Jump to content

Port bound error.


swarnava9

Recommended Posts

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 help

int sc_main(int argc, char* argv[]) {
int i;
char nodeName[19];

//signals to connect data and mul ports
sc_signal data_sig[NUM_TAP + 1];
sc_signal mul_sig[NUM_TAP];
sc_signal result;

//system clock
sc_clock* sys_clock;

//pointer for modules
Memory* mem;
FirNode * firnodes[NUM_TAP];
Accumulator* accu;


// create global clock
sys_clock = new sc_clock("SYSTEM_CLOCK", 1, SC_NS);

//Construct Memory and Accumulator modules
mem = 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 memory
mem->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 accumulator
accu->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 simulation
sc_start(300, SC_NS);
return 0;
}v
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...