Jump to content

Error: (E109) complete binding failed: port not bound


Recommended Posts


I'm trying to write an abstract module and create concrete modules to apply polymorphism. I created a MWE to reproduce the error:

#include <systemc>
using namespace sc_core;

class AbstractModule : public sc_module
    sc_in<double> input;
    sc_out<double> output;
    AbstractModule(const sc_module_name &name) : sc_module(name) {}

class Module1 : public AbstractModule
    Module1(const sc_module_name &name) : AbstractModule(name)
    { }

class Module2 : public AbstractModule
    Module2(const sc_module_name &name) : AbstractModule(name)
    { }

int sc_main(int argc, char *argv[])
    Module1 m1("Module1");
    Module2 m2("Module2");
    AbstractModule *am1 = &m1, *am2 = &m2;

    return 0;

And when I run this code, I get the error below:

Error: (E109) complete binding failed: port not bound: port 'Module2.port_1' (sc_out)
In file: ../../../src/sysc/communication/sc_port.cpp:235

What am I doing wrong?

Link to comment
Share on other sites

17 hours ago, Eyck said:

Both modules m1 and m2 in sc_main have signal ports. These ports have to be connected to signals in sc_main.

Thank you. I've been binding the ports(not in the code above) but I was getting the error. Your reply made me see my error, I was trying to bind the ports of m2 after the simulation has been started. Binding all before the simulation start solved my problem.

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.

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...