Jump to content
Sign in to follow this  
cliffc

global_stop_request() does not work in UVM?

Recommended Posts

Does the global_stop_request() command still work in UVM?

I know the preferred mechanism to stop tests is to raise and drop objections.

In the test1 raise/drop objection example below, the test runs for 100ns and prints two messages.

In the test2 global_stop_request() example below, the test runs for 0ns and only prints the time-0 message.

class test1 extends uvm_test;

`uvm_component_utils(test1)

function new (string name="test1", uvm_component parent);

super.new(name, parent);

endfunction

task run_phase(uvm_phase phase);

phase.raise_objection(this);

`uvm_info("test1", "test1 started ...", UVM_MEDIUM)

#100ns;

`uvm_info("test1", "test1 ran 100ns ...", UVM_MEDIUM)

phase.drop_objection(this);

endtask

endclass

class test2 extends uvm_test;

`uvm_component_utils(test2)

function new (string name="test2", uvm_component parent);

super.new(name, parent);

endfunction

task run_phase(uvm_phase phase);

`uvm_info("test2", "test2 started ...", UVM_MEDIUM)

#100ns;

`uvm_info("test2", "test2 ran 100ns ...", UVM_MEDIUM)

global_stop_request();

endtask

endclass

Regards - Cliff Cummings

www.sunburst-design.com

Share this post


Link to post
Share on other sites

Hi Cliff,

Didn't you write a paper on this?

If you use stop_request() and/or global_stop_request(), then you will need to use the plusarg +UVM_USE_OVM_RUN_SEMANTIC, otherwise your testbench will end prematurely without awaiting your stop_request().

Share this post


Link to post
Share on other sites

Hi, Dave -

Why yes I did write a paper on this topic, but the paper was released before UVM was released, so the paper addressed OVM run-time semantics.

Thanks for the plusarg switch. I did not know that this switch existed. I will give this a try.

Thanks-much for the reply. I'm not sure where I would have found documentation on this command line switch.

Regards - Cliff

Share this post


Link to post
Share on other sites

Hi cliffc,

In UVM GOLDEN Reference Guide, Page 63, it is mentioned that "UVM provides an "objection" mechanism for this purpose. Other methods of stopping simulation, which were used in OVM and UVM-EA, such as calling global_stop_request, are deprecated in UVM.

So in order to make it compatible to OVM, you should use the switch posted by dave_59, I think.

Regards,

Hi, Dave -

Why yes I did write a paper on this topic, but the paper was released before UVM was released, so the paper addressed OVM run-time semantics.

Thanks for the plusarg switch. I did not know that this switch existed. I will give this a try.

Thanks-much for the reply. I'm not sure where I would have found documentation on this command line switch.

Regards - Cliff

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  

×