Jump to content

Accessing unique process_id of a systemC process

Recommended Posts



I want to access the unique process id of a SystemC process P inside process P. Can I do that? If yes, what is the API for that?


The base class for all sc_process is class sc_process_b. sc_method_process and sc_thread_process are derived from it. sc_process class has a public member variable, called proc_id. This denotes the unique id of a process.


My question is how to access this id inside the process itself. For example:


Inside process P:


std::cout << proc_id << std::endl;


does not work!




Share this post

Link to post
Share on other sites

First of all, sc_process_b is not a standardized class, it's implementation specific.

Instead, you can use the sc_process_handle class to identify your processes, see IEEE 1666-2011, clause 5.6 for details.  The current process handle can be obtained by the function sc_get_current_process_handle:

std::cout << sc_core::sc_get_current_process_handle().name() << std::endl;

Greetings from Oldenburg,

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