euphony Posted September 12, 2019 Report Share Posted September 12, 2019 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 Error: (E109) complete binding failed: port not bound: port 'FIR_NOD[17].port_4' (sc_out) here my NUM_TAP is 18 I'm attaching the code with this message. It seems to me that I have connected the ports correctly. Please help #include "systemc.h" #include "type.h" #include "mem.h" #include "fir_node.h" #include "accumulator.h" #include "main.h" int sc_main(int argc, char* argv[]) { int i; char nodeName[19]; //signals to connect data and mul ports sc_signal<data_type> data_sig[NUM_TAP + 1]; sc_signal<data_type> mul_sig[NUM_TAP]; sc_signal<data_type> 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); //[Missing] connect ports of fir_nodes for (i=0;i<NUM_TAP;i++) { firnodes->data_in(data_sig); firnodes->mul_out(mul_sig); firnodes->clock(*sys_clock); firnodes->data_out(data_sig[i+1]); } //connect ports of accumulator accu->clock(*sys_clock); accu->data_in(data_sig[NUM_TAP]); 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;}please suggest as of what changes i can make Quote Link to comment Share on other sites More sharing options...
David Black Posted September 12, 2019 Report Share Posted September 12, 2019 Port not bound means that you forgot to connect a port. SystemC does not allow unconnected ports (at least not without some extra work). If you didn't name your port instances explicitly, SystemC arranges to have them named "port_0", "port_1", "port_2", ... etc. So you apparently have five ports on some module and you've only connected four of them. Quote Link to comment Share on other sites More sharing options...
euphony Posted September 13, 2019 Author Report Share Posted September 13, 2019 yeah thank you. i got it:) Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted September 13, 2019 Report Share Posted September 13, 2019 I guess you need some extra changes: firnodes = new FirNode(...) firnodes->data_in(...) accu->mul_in(mul_sig) etc. Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted September 13, 2019 Report Share Posted September 13, 2019 Forget that last post, it seems that brackets etc. are not displayed in the posts. 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.