Jump to content

When a phase completes, are any lingering processes terminated?


Recommended Posts

Q1) If I use a fork-join_none to spawn a process in a phase, and then that phase ends (b/c objection is dropped), is the process terminated or allowed to complete?

 

 

I seem to be seeing that the process is terminated (but was expecting that it would be allowed to complete) and wanted to confirm that this is the expected behavior.  

Q2) Where is this behavior best documented?

 

 

(Context: I was moving my timeout-timer from main_phase to pre_reset_phase, so that its time begins at time==0.  If processes are killed when a phase ends, I suppose I should move it to run_phase to align it with time==0, ..... or start using the heartbeat component, which I have not gotten around to doing yet, but have been thinking a lot about.)

 

Link to comment
Share on other sites

Thanks a lot, /uwe.  That was very helpful.

 

My notes, for when I encounter this again:

 

1) from uvm_component.svh    (note: "Any threads spawned in this callback are not affected when the phase ends.")



  // Function: phase_started
  //
  // Invoked at the start of each phase. The ~phase~ argument specifies
  // the phase being started. Any threads spawned in this callback are
  // not affected when the phase ends.


  extern virtual function void phase_started (uvm_phase phase);


// phase_started
// -------------
// phase_started() and phase_ended() are extra callbacks called at the
// beginning and end of each phase, respectively.  Since they are
// called for all phases the phase is passed in as an argument so the
// extender can decide what to do, if anything, for each phase.


function void uvm_component::phase_started(uvm_phase phase);
endfunction


 

2) from uvm_task_phase.svh  (note:  "Once the phase completes, any remaining forked ...

threads are forcibly and immediately killed.")



//------------------------------------------------------------------------------
//
// Class: uvm_task_phase
//
//------------------------------------------------------------------------------
// Base class for all task phases.
// It forks a call to <uvm_phase::exec_task()>
// for each component in the hierarchy.
//
// The completion of the task does not imply, nor is it required for,
// the end of phase. Once the phase completes, any remaining forked
// <uvm_phase::exec_task()> threads are forcibly and immediately killed.
//
// By default, the way for a task phase to extend over time is if there is

Link to comment
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...