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

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.

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