Tanja Posted February 19, 2013 Report Share Posted February 19, 2013 Hello, assume i have a module "mod" with the following constructor: mod(sc_module_name name, unsigned int id); How can i accessed the module name stored in the variable name to print it out? thanks. Quote Link to comment Share on other sites More sharing options...
Tanja Posted February 19, 2013 Author Report Share Posted February 19, 2013 solved Quote Link to comment Share on other sites More sharing options...
David Black Posted February 19, 2013 Report Share Posted February 19, 2013 You should include the "solution"; otherwise, this thread is useless to others. I assume the solution was to use sc_object::name() method, which returns the full hierarchical name and is accessible in a module as simply name(). It is possible you were needing basename() or kind(). See IEEE-1666-2011 for more information on sc_object. maehne 1 Quote Link to comment Share on other sites More sharing options...
Tanja Posted February 19, 2013 Author Report Share Posted February 19, 2013 ok. My solution was to declare a member variable of type string, which i then initialize with the value of variable name (of type sc_module_name) in the conctructor of my module. std::string mod_name; mod_name = name; 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.