Aarthi Posted June 15, 2018 Report Share Posted June 15, 2018 Hello, I need a help, Its a huge implementation like having A, B, C systemC Modules and instantiated in the Top and sc_main have the Top hierarchy sc_module_name. In the systemC Module A, i have lot of pure C++ classes and instantiated so many times like some algorithm to do some computation. While debugging difficult to get the hierarchy which one is printing or tracing. I am looking for a solution, without changing the pure C++ classes to derive from sc_module, how do i make it a hierarchy to Top. Changing every where to have a constructor with sc_module_name will be little difficult as the code is huge. Is there any suggestion? Regards Aarthi Quote Link to comment Share on other sites More sharing options...
Eyck Posted June 15, 2018 Report Share Posted June 15, 2018 Hi Aarthi, if you just need to get the currently active module when hitting a breakpoint in you C++ code you might use the following command (assuming you use gdb): x sc_core::sc_get_current_process_b()->get_parent()->name() (see also here: https://stackoverflow.com/questions/18078226/how-to-get-sc-module-name-of-the-current-running-module#18123785) What it does is it calles the SystemC kernel function sc_get_current_process_b() which returns a pointer to sc_process_b (the base class of of sc_method_process and sc_thread_process). Inheriting from sc_obejt it also has a name() method so you could also do x sc_core::sc_get_current_process_b()->name() which just returns the full hierarchical name of the process. HTH -Eyck sumit_tuwien and veeresh k 2 Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted June 16, 2018 Report Share Posted June 16, 2018 Hi all, 16 hours ago, Eyck said: x sc_core::sc_get_current_process_b()->get_parent()->name() Both sc_get_current_process_b() and get_parent() are non-standard functions that may or may not be supported by (future) versions of your SystemC implementation. I recommend to only use standard IEEE 1666-2011 APIs instead: x sc_core::sc_get_current_process_handle().get_parent_object()->name() x sc_core::sc_get_current_process_handle().name() Greetings from Duisburg, Philipp maehne 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.