Sequence ends quickly

I am seeing that my sequence execution doesn’t proceed ahead beyond the display statement. I am not sure why the piece of code inside the repeat block doesn’t get executed. The test completes gracefully, so I am guessing the piece of code was not executed for some reason. The code itself is part of some of my experiments and doesn’t send anything down to the sequencer. But I am not sure why the repeat block doesn’t get executed. Any idea on what might be causing this?


virtual task body();
  $display ("Starting sequence");
  repeat (10000) begin
    @(posedge tb_top.clk);
    $display("Time is %t", $realtime());
endtask

In reply to tpan:

Can you post more code how clock is initialized and task is called etc? The below code seems to be working fine.



module tb;
bit clk =0;
  
  initial repeat (10) begin
    #2 clk =!clk;
  end
  
   task run();
    $display ("Starting sequence");
     repeat (10) begin
  @(posedge clk);
    $display("Time is %t", $realtime());
    end
endtask
  
  initial begin
     run();
    end
endmodule

In reply to tpan:

This may be due to objection isn’t raised. when you don’t raise the objection, run phase will finish in 0 simulation time. So raise the objection in your test case run/main phase.


//uvm test case main phase

  virtual task main_phase(uvm_phase phase);
    super.main_phase(phase);   
    phase.raise_objection(this, "raise objection");  //raise objection
    
    /* //start your sequence here
    seq1 = my_sequence_1::type_id::create("seq1");
    seq1.randomize();
    seq1.start(env.agt.sequencer);
    */
    
    phase.drop_objection(this, "drop objection");  //drop objection
  endtask : main_phase


In reply to Rahulkumar:

Thanks for your responses. I figured out the issue in my code. I was raising/dropping objections but I was starting multiple sequences on different interfaces under fork-join_none. Fixing it to fork-join resolved the issue.