Tuesday, 2 February 2016

Explain about run_test() in UVM



Execute all component’s all registered phases.
If the optional test_name argument is provided, or if a command-line plusarg, +UVM_TESTNAME=TEST_NAME, is found, then the specified component is created just prior to phasing.
The test may contain new verification components or the entire test-bench, in which case the test and test-bench can be chosen from the command line without forcing recompilation.
If the global (package) variable, finish_on_completion, is set, then run_test will call $finish after all phases are executed.

  1. Take string name from plusarg (+UVM_TESTNAME ) or its own argument ,
    1. if ($value$plusargs("UVM_TESTNAME=%s", test_name)) begin
  2. Create uvm_test_top using below command
    1. $cast(uvm_test_top, factory.create_component_by_name(test_name, "", "uvm_test_top", null));
  3. Call m_run_phases of uvm_phase class,
    1. Which execute all registered phases of all componenets in pre-defined order.
  4. Wait for all phases to be completed,
  5. If the global (package) variable, finish_on_completion, is set, then run_test will call $finish after all phases are executed.
    1. By-default finish_on_completion bit is set to 1 only

Reference:
1) uvm_root.svh file from uvm source code
 

3 comments:

  1. Hi.

    i'm studing about uvm..
    this page's phasing, what is mean phasing?

    Can you explain?

    ReplyDelete
  2. Hi,
    This post is about how a particular test-case is run in UVM when you call run_test to run that test.

    UVM Phases is used to control the behavior of simulation in a systematic way & execute in a sequential ordered to avoid race condition.
    For more detail please refer my other post http://sagar5258.blogspot.com/2016/04/uvm-faq2.html

    ReplyDelete