# How to finish the forever until other component done?

**URL:** <https://verificationacademy.com/forums/t/how-to-finish-the-forever-until-other-component-done/40958>\
**Category:** UVM\
**Tags:** UVM, uvm\_objection, forever\
**Created:** [October 29, 2022, 3:39pm UTC](https://verificationacademy.com/forums/t/how-to-finish-the-forever-until-other-component-done/40958 "2022-10-29T15:39:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![UVM\_LOVE](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/uvm_love/32/1684_2.png) [@UVM\_LOVE](https://verificationacademy.com/forums/u/UVM_LOVE)\
**Post date:** [October 30, 2022, 10:19pm UTC](https://verificationacademy.com/forums/t/how-to-finish-the-forever-until-other-component-done/40958/3 "2022-10-30T22:19:53Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/how-to-finish-the-forever-until-other-component-done/40958/2):_

Thank you Dave, I removed objections, still never stop. So I add delay #1;  
I’m not sure whether adding delay is correct or not.  
Now I’m referencing [AnalysisConnections | Verification Academy](https://verificationacademy.com/cookbook/analysisconnections)  
there is no #Delay implemented in.

```verilog
 task run_phase( uvm_phase phase );
   alu_txn before_txn, after_txn;
   forever begin
     before_fifo.get(before_txn);
     after_fifo.get(after_txn);
     if (!before_txn.compare(after_txn)) begin
       `uvm_error("Comparator Mismatch",
                  $sformatf("%s does not match %s", before_txn.convert2string(), after_txn.convert2string()))
       m_mismatches++;
     end else begin
       m_matches++;
     end
   end
 endtask

```

If I add delay, **analy\_fifo.get(trans);** is working as my expectation.  
But why do I need to add the # dealy ? even the referencing code does not implemented # delay code.  
If I get rid of #Delay then it never stop.

```verilog

//component_b
///...

forever begin
  #1; //<== ???
      `uvm_info(get_type_name(), $sformatf(" FIFO used: %0d", analy_fifo.used()), UVM_LOW)   
      if(analy_fifo.is_empty()) begin
        `uvm_info(get_type_name(), "FIFO is Empty!!!!!",UVM_LOW)
      end
      else begin
        analy_fifo.get(trans);
      `uvm_info(get_type_name(),$sformatf(" Printing receive trans, \n ",trans.sprint()),UVM_LOW)
      end
  end

```

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-finish-the-forever-until-other-component-done/40958)._
