katang Posted August 22, 2020 Report Share Posted August 22, 2020 I am trying to figure out what module fired. My idea is shown below: the main program runs till the next event, and stops. At that point, I guess, there is no "current_process", so the lines in the comment do not work. Is there something similar for "past_process"? while(sc_pending_activity_at_future_time()) { sc_start( sc_time_to_pending_activity() ); // Run up to the next activity} /* sc_process_handle T = sc_get_current_process_handle(); sc_object* P = T.get_parent_object(); sc_object *Q = sc_get_current_process_b()->get_parent_object();*/ */ Quote Link to comment Share on other sites More sharing options...
maehne Posted August 24, 2020 Report Share Posted August 24, 2020 As you already found out, sc_get_current_process_handle() is not suitable, which is confirmed by IEEE Std 1666-2011, clause 5.6.7: "When called from sc_main during simulation, sc_get_current_process_handle shall return an invalid handle." To my knowledge, the standard does not define a function, which would return directly the information you want to obtain. I would suggest to augment your models with suitable logging code, which might be conditionally activated once your simulation enters an interesting phase. Logging could be done in the simplest case to the console or you might hand the information over to some global function/object first, which processes further the information before storing/outputting it. 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.