To get the name of the module that is currently running in systemc:
Use sc_get_current_process_b to get the current executable process (thread or SC method). Then use get_parent to get its parent, which will be the module. Then use basename or name to get its name:
const char* name = sc_core::sc_get_current_process_b()->get_parent()->basename();
(error handling omitted for brevity)
source share