Jump to content
Sign in to follow this  
ryz

How to correctly kill an virtual sequence

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×