Scope of disable fork

In reply to ashish_banga:

Scope, like the code within a task or begin/end block, has no effect on the functionality of disable/wait fork. See https://verificationacademy.com/forums/systemverilog/confusion-fork-join-…-disable-fork#reply-38941

However, when you call the start() method of a sequence, the code inside start task looks like

task start();
 ...
   fork
     begin
      ...
      pre_body();
      ...
      body();
      ...
      post_body();
      ...
     end
   join
 ...
endtask

So executing a disable fork inside the body() task will potentially kill the processes created by the pre_body() and body() tasks. It cannot affect any process created outside the fork within the start method.

The same is true for all the run_phase() tasks. There are all fork’ed into independent processes.