ljepson74 Posted February 26, 2014 Report Share Posted February 26, 2014 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.) Quote Link to comment Share on other sites More sharing options...
uwes Posted February 26, 2014 Report Share Posted February 26, 2014 hi, the answer is "it depends". - threads started inside or as a child-thread of xyz_phase() are terminated before phase progression - threads started inside phase_started() are NOT terminated automatically and continue to run until normal end or explicit termination. /uwe ljepson74 1 Quote Link to comment Share on other sites More sharing options...
ljepson74 Posted February 26, 2014 Author Report Share Posted February 26, 2014 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 ljepson74 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.