Process control

In reply to verif_learner:

Nesting forever loops seems very suspicious. Also a forever loop without any blocking statement gets you into a deadlock situation where time cannot advance. What you probably want is

task send_transaction (rx_function_st_txn_seq_item req);
        while (!condition) begin
          ...
        end
endtask

or maybe

task send_transaction (rx_function_st_txn_seq_item req);
    fork
      begin
        fork 
        forever begin
          ...
        end
        join_none
        wait(condition) disable fork;
      end
    join
endtask

You can also have a break statement inside a forever loop to exit the loop.