Jump to content

jroever

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Thank you! dakupoto for the quick response - and "danke schoen!" Philip for the elaborate one. The static function method will create the nice compact and encapsulated coding style that I was looking for. It was very interesting to look into the inner workings of the sc_module_name methods and I was curious whether this was something that might change at some point ... given the quote from the IEEE spec I assume this will stay a permanent requirement - which seems totally acceptable. The strong coupling with XML comes from the desire to build a simulation environment that can be reconfigured without the need to recompile - working great so far Cheers, Jens
  2. I derived a class from sc_module that handles it's own configuration from an XML node passed to the new module constructor. One of the pieces of information handed down in the XML node is the modules name. ///Constructor my_module::my_module ( pugi::xml_node *node ///< xml node pointer ) : sc_module ( node->attribute("name").value() ) , clock ( "clock_in" ) , targ_socket ( "targ_socket" ) , init_socket ( "init_socket" ) { ... } This will result in the following warning: Warning: (W569) sc_module(const char*), sc_module(const std::string&) have been deprecated, use sc_module(const sc_module_name&): my_mod In addition the system seems to get confused and complains about already existing hierarchical names ... Using sc_module_name inside the constructor initialization list takes care of the warning but the created name is missing the hierarchy push from "my_module" ... ... : sc_module ( sc_module_name(node->attribute("name").value()) ) ... I believe this is due to the fact that sc_module_name is not created on the stack and it's destructor is called before the constructors of the other entities (i.e. clock) is called ... What would be the appropriate way to achieve a module name function inside the initialization list constructor?!? Thanks for any pointers! - Jens
×