Sequences in fork...join_none

Hi all,
in testcase i have called sequences , but which is not working as per expecations, can anyone helpme in telling where I am going worng ?


task run_phase(uvm_phase phase);
phase.rasie_objections();
begin
 for(int k=0;k<4;k++) begin
 fork
  @(posedge clk[k]_in) if(enable[k]==1) begin
       cap_seq[k].start(env.agent[k].seqr);
  end
  join_none
 end
wait fork;
end
phase.drop_objections();
endtask

In reply to rohit_kumar:
It always helps to explain what your expectations are versus what you see happening, especially when you have provided so little code.

See this post for a possible problem.

In reply to dave_59:

Hi Dave,
as soon as enable is high, the 4 sequences should start parallel at the next posedge clk available, but in this case the sequence is not starting, even though enable is high. I do know where i am going worng, please let me know …


task run_phase(uvm_phase phase);
phase.raise_objections();

fork 

 begin
   env_h.reg_blk.enable.set(4'b1111);
   env_h.reg_blk.update(.path(UVM_FRONTDOOR),.parent(null),.status(status)));
 end


 begin
   for(int k=0;k<4;k++) begin
     automatic int j = k;
      fork
        @(posedge clk[j]_in) if(enable[j]==1) begin
           cap_seq[j].start(env.agent[j].seqr);
         end
      join_none
    end
    wait fork;
 end

join

phase.drop_objections();
endtask

In reply to rohit_kumar:
Not sure what you mean by
clk[j]_in
. Perhaps you meant
clk_in[j]
.

Once that is fixed, your code does not wait for
enable
to be high; it only checks it once on the first clock cycle. You probably want

  @(posedge clk_in[k] iff (enable[k]==1)) begin

In reply to dave_59:

Thanks Dave :)

regarding clk ya it was typo error. after using “iff” it worked, but can you explain why the earlier code with

 @(posedge clk[j]_in) if(enable[j]==1) begin 

was not working.

In reply to rohit_kumar:

after using “iff” it worked, but can you explain why the earlier code with

 @(posedge clk[j]_in) if(enable[j]==1) begin 

was not working.

Because it only checks enable[j] once at the first clock cycle and the process terminates after that.

In reply to dave_59:

got it
Thank you Dave :)