title: SystemC - How can I get the module name to which sc_signal connected?
body: <p>I'd like to print out the name of sc_module to which sc_signal connected.</p>
  
  <p>How can I get the module name, "module_a" in the following code, from "sig_out"?</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "systemc.h"
  
  class sig_if : virtual public sc_interface
  {
  };
  
  class my_sig : public sc_module, public sig_if
  {
  public:
      my_sig(sc_module_name nm) : sc_module(nm)
      {
      }
  };
  
  SC_MODULE(test_module)
  {
      sc_port&lt;sig_if&gt; out;
  
      SC_CTOR(test_module)
      {
      }
  };
  
  int sc_main(int argc, char* argv[]) {
  
      test_module module_a("module_a");
      my_sig sig_out("sig_out");
  
      module_a.out(sig_out);
      // std::cout &lt;&lt; sig_out.get_parent() &lt;&lt; std::endl;
  
      sc_start();
      return 0;
  }
  </code></pre>