Jump to content

Is the "past process" remembered by the kernel?


Recommended Posts

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();*/

*/

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...