Fork join_none with forever loops causes the test hang

Hi,

I have the following code inside ovm sequencer class:

class ...
.
.
.
  task ...()
  .
  .
  .
      fork
        forever 
        begin
        ...  
        end
        forever
        begin
        ...
        end
       join_non
 endtask
endclass

The code inside forever loops is simple “force” statements.
But it causes my test to hang and not move forwards to execution of next sequences outside this class.
It seem to be stuck in the forever loops although there’s join_none.
Can you please advise why it hangs in the forever loops? and how can fix this and cause the forever loops to be executed in parallel (in the background) while another sequence should be executed next.

Thanks

In reply to samid:

A forever loop needs some kind of blocking statement, otherwise time cannot advance outside the loop.

In reply to dave_59:

When generating a clock one usually uses forever loop and it runs in parallel to other tasks/sequences.
Why does it work in the clock case and doesn’t work in my case?

Thanks

In reply to samid:
A
forever
loop used to generate a clock has a blocking delay in it; usually half the period. Any kind of loop needs to terminate or have a blocking statement in order for time to advance. Otherwise you wind up needed to execute an infinite number of statements in one timestep.

In reply to dave_59:

ok, I understand now.
Thanks.