Why does the clock behaves differently when it is put in blocking statement?

Example, Blocking assignments evaluate their RHS
expression and update their LHS value without interruption. The blocking assignment must
complete before the @(clk) edge-trigger event can be scheduled. By the time the trigger event
has been scheduled, the blocking clk assignment has completed; therefore, there is no trigger
event from within the always block to trigger the @(clk) trigger.

module osc1 (clk);
 output clk;
 reg clk;
 initial #10 clk = 0;
  always @(clk) #10 clk =~clk;   //Note I have intentionally made it to blocking
 
  initial
    begin
      #200;
      $finish;
    end
   initial
    begin
      $monitor($time,"clk %0b ",clk);
    end
  initial
    begin
      $dumpvars;
      $dumpfile("dump.vcd");
    end
  
endmodule

Note:
The clk signal is driven to 0 at 10ns. but after that it remains in logic 0 till the end of the simulation

In reply to Arun_Rajha:

always @(clk) triggers only when there is a change in value. your simulation ends at 20ns. If you keep ur cursor at 20ns you will see clock value changing to 1, but since your simulation ended exactly at same place you dont see the transition 0 to 1.

In reply to rag123:

@rag123
My simulation ends after 200ns

In reply to Arun_Rajha:

Can you check in the waveform?

In reply to rag123:

so why it is ending at 20ns as i have mentioned as 200ns in the module itself.

In reply to Arun_Rajha:


module osc1 (clk);
output clk;
reg clk;


  initial begin
  repeat (20) begin
  #10 clk =~clk;
  end
  end

initial
begin
  #10 clk =0;
   $dumpvars(0,osc1);
   $dumpfile("dump.vcd");
   $monitor($time," clk %0b ",clk);
#200;
$finish;
end
endmodule

In reply to rag123:

Incase the question is why the always block doesnt execute by itself ?
https://verificationacademy.com/forums/systemverilog/not-able-generate-clock-using-always-block

In reply to Arun_Rajha:

Example, Blocking assignments evaluate their RHS …

Check this thread:

In reply to Rahulkumar Patel:

Thanks, I understood now.