Jump to content
Tanja

Module name

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×