Jump to content

Recommended Posts

Posted

I have an virtual sequence that sets up the dut and then send either an specified number of packages or send packages infinitive. In the later case I want to be able to kill the sequence when I have simulated enough time. The problem is that it seems that only the virtual sequence is killed and none of the children sequence is killed. Since it is a child sequence running on an other sequencer that send package infinitive this is not good.

In my test I would like to call virt_seq.kill() and make everything that sequence do stop.

Posted (edited)

Hi There,

I think following simple example could help you kill sub_sequnces.

function void kill_them_all (uvm_sequence_base _sub_seq);

uvm_sequence_state_enum seq_state;

if(_sub_seq != null)

begin

seq_state = _sub_seq.get_sequence_state();

if(!(seq_state & (STOPPED|FINISHED)))

begin

`uvm_info("kill seq",$psprintf("'%s' is %s , be killed....", _sub_seq.get_name(),seq_state.name()),UVM_NONE)

_sub_seq.kill()

end

endfunction : kill_them_all

However, This will not check if the driver is currently processing any sequence_items and the result is item_done() or not. and It may cause UVM fatal errors to occur because the sequences return pointer queue has been flushed.So don't use this method unless you could make sure the drive is inactive before killing the sequences.

Edited by Roman
Posted

So using kill on the virtual sequence is not really an option here.

I guess I could implement an stop function in both the virtual sequence and the sequence sending packages forever. The virtual sequence stop function will call the child sequence stop function.

The child sequence stop function can set an internal bit that to stop sending more packages and make an while(stop_bit) instead if an forever. I thought that UVM already had an way to nicely stop sequences but apparently not.

  • 12 years later...
Posted


   function void kill_running_seq (uvm_sequence_base _sub_seq);
     uvm_sequence_state_enum seq_state;

     if(_sub_seq != null) begin
       seq_state = _sub_seq.get_sequence_state();
       if(!(seq_state inside {UVM_STOPPED|UVM_FINISHED}))
       _sub_seq.kill();
       end
   endfunction: kill_running_seq

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...