ashwathgan Posted June 16, 2015 Report Share Posted June 16, 2015 Hi I have two modules and they look as follows: class Derived: public Base,public sc_module { ... .... ... Derived(sc_module_name name):sc_module(name){} }; SC_MODULE(Mysystem) { .... ..... SC_CTOR(Mysystem) {} }; int sc_main(...) { Mysystem MS("mine"); Derived D("derived"); sc_start(); } I get error: <E533> module name stack is empty : did you forget to add a parameter to your module constructor? Why it is showing this error though i provide a module name for "Derived"class?? Note: I ran without having "derived" as the Systemc module and it worked. but, it shows an eror otherwise. Quote Link to comment Share on other sites More sharing options...
kartikkg Posted June 16, 2015 Report Share Posted June 16, 2015 Is the public Base also an sc_module? Quote Link to comment Share on other sites More sharing options...
ashwathgan Posted June 16, 2015 Author Report Share Posted June 16, 2015 Nope, it is a normal C++ class Quote Link to comment Share on other sites More sharing options...
tjroamer Posted June 16, 2015 Report Share Posted June 16, 2015 You could have other constructors in your Derived class. When you create the instance D, the constructor Derived(sc_module_name name):sc_module(name){} is not called, instead, a constructor like Derived(const char* par) {} is called. You may need to check the body of the Derived class. Quote Link to comment Share on other sites More sharing options...
dakupoto Posted June 17, 2015 Report Share Posted June 17, 2015 Hi I have two modules and they look as follows: class Derived: public Base,public sc_module { ... .... ... Derived(sc_module_name name):sc_module(name){} }; SC_MODULE(Mysystem) { .... ..... SC_CTOR(Mysystem) {} }; int sc_main(...) { Mysystem MS("mine"); Derived D("derived"); sc_start(); } I get error: <E533> module name stack is empty : did you forget to add a parameter to your module constructor? Why it is showing this error though i provide a module name for "Derived"class?? Note: I ran without having "derived" as the Systemc module and it worked. but, it shows an eror otherwise. Hello Sir, SystemC is a C++ library. Please look up a good reference on C++, especially the chapters on multiple inheritance. Please clear your basics first. Hope that helps. Quote Link to comment Share on other sites More sharing options...
ashwathgan Posted June 17, 2015 Author Report Share Posted June 17, 2015 My Bad, I forgot to add the proper parameters in the constructor and completly overlooked it. its fixed. Thanks 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.