# Forever loop inside a fork-join\_none

**URL:** <https://verificationacademy.com/forums/t/forever-loop-inside-a-fork-join-none/41631>\
**Category:** SystemVerilog\
**Tags:** fork\_join, SystemVerilog, forever-loop\
**Created:** [May 7, 2023, 4:41am UTC](https://verificationacademy.com/forums/t/forever-loop-inside-a-fork-join-none/41631 "2023-05-07T04:41:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ritvik\_Kumar](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/858c86/32.png) [@Ritvik\_Kumar](https://verificationacademy.com/forums/u/Ritvik_Kumar)\
**Post date:** [May 7, 2023, 4:41am UTC](https://verificationacademy.com/forums/t/forever-loop-inside-a-fork-join-none/41631/1 "2023-05-07T04:41:33Z")

</div>

Hi,

I have a piece of code like the one below:

```verilog

initial 
begin
if(testname !== "test_1")
begin : block1
$display("TRIAL1 at line = %0d instance = %m",` __LINE__ );
fork 
	begin
		forever
			begin
				@(posedge flag2);					
				$assertkill(0, top_tb.tb_file1.sb_if.ap_1);
				`uvm_info("",$sformatf("TRIAL1 Entered at line = %0d Testcase name = %s at time = %t instance = %m",` __LINE__ ,testname,$realtime),UVM_LOW)
		
					                
			end
	end
	begin
		if(stop)
			begin				
				$display("TRIAL1 block1 disabled at time = %t",$realtime);
	        	        disable block1;
			end
	end

join_none
end : block1

if(testname !== "test_1")
begin : block2
$display("TRIAL2 at line = %0d instance = %m",` __LINE__ );
fork
	begin
		forever
			begin
		
				@(negedge flag2);
				$asserton(0,top_tb.tb_file1.sb_if.ap_1);	
				`uvm_info("",$sformatf("TRIAL2 Entered at line = %0d Testcase name = %s at time = %t instance = %m",` __LINE__ ,testname,$realtime),UVM_LOW)
				
					
			end
	end
        begin
		if(stop)
			begin
				$display("TRIAL2 block2 disabled at time = %t",$realtime);
				disable block2;
			end

	end  

join_none
end : block2
end

```

Question: I’m seeing that TRIAL1 and TRIAL2 statements are getting printed. For the simulation that i’m running any one of the two @(posedge flag2) or @(negedge flag2) would definitely get executed. With this i should be able to see the `uvm_info print statement on my log. But i'm not seeing the print statement at all from the `uvm\_info. I’m also not seeing this print statement : $display(“TRIAL2 block2 disabled at time = %t”,$realtime); and $display(“TRIAL2 block2 disabled at time = %t”,$realtime);.

I’m just not understanding why the `uvm\_info statements are not getting printed.

I appreciate any insights you can provide.

Regards,  
Ritvik

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 7, 2023, 3:42pm UTC](https://verificationacademy.com/forums/t/forever-loop-inside-a-fork-join-none/41631/2 "2023-05-07T15:42:19Z")

</div>

_In reply to [Ritvik Kumar](https://verificationacademy.com/forums/t/forever-loop-inside-a-fork-join-none/41631):_

You have not shown enough information about how flag2 and stop get stimulated to reproduce your issue. I presume you want **wait(stop)** instead of **if(stop)**.
