Welcome ! This website will help YOU (recent graduates/professionals) learn verification languages like SystemVerilog and UVM. Register for free and access more content !
1 minute reading time (245 words)

how run_test( ) starts the simulation ?

how run_test( ) starts the simulation ?

Tests can be run in a UVM environment by either specifying the testname as an argument to run_test() or as a command-line argument using +UVM_TESTNAME="[test_name]". This can be considered an entry point to how UVM starts each component, configures and runs a simulation. There are a set of UVM core services within the structure, capable of providing instances to the factory and the root object. We'll see how the general flow looks like in the short explanation that follows.

module tb_top;
  // Import required packages 
  import uvm_pkg::*;
 
  // Instantiate DUT and interfaces
  dut   dut0 (...);
  dut_if   _if0 (...);
 
  // Call run_test();
  initial begin
    run_test ("base_test");
  end
endmodule
 

run_test( ) within tb_top as shown above, is a global task which is responsible for getting a reference to the uvm_root class instance from UVM core services. There is another run_test( ) method within uvm_root to initialize factory settings, report servers, and do basic level checks to ensure that you have either provided a proper testname or that atleast one component has been declared in the environment upon which UVM can work.

The main component that controls simulation in a UVM environment is the uvm_phase class instance. This will start running phases one by one using m_run_phases() method. The report server records all the INFO, WARNING and ERROR messages generated by various testbench components throughout the simulation. Once all the phases are over, a summary will be printed out, and simulation will exit via $finish.

how to set a timeout value for simulations ?
System Use Cases
 

Comments 2

Chaitanya Kshirsagar on Thursday, 24 November 2016 22:30

run_test() will start executing phsese, but how function new() in components and object get executed?

run_test() will start executing phsese, but how function new() in components and object get executed?
Aravind Prakash on Friday, 25 November 2016 06:10

function new() is a class constructor and will always be executed when an object of that class is created. In UVM, objects are normally created by the factory using the create() method which will return an object of the type we ask for. Components are built during the build() phase so that they can be well connected before the start of any simulation. We do not want any components to be created in the middle of a simulation because it simply creates uncertainty and possible NULL handle errors. However, objects can be created anytime because they represent data and hence is dynamic in nature.

function [i]new()[/i] is a class constructor and will always be executed when an object of that class is created. In UVM, objects are normally created by the factory using the [i]create()[/i] method which will return an object of the type we ask for. Components are built during the [i]build()[/i] phase so that they can be well connected before the start of any simulation. We do not want any components to be created in the middle of a simulation because it simply creates uncertainty and possible NULL handle errors. However, objects can be created anytime because they represent data and hence is dynamic in nature.
Already Registered? Login Here
Guest
Monday, 25 June 2018

We use cookies to personalize content and ads, to provide social media features and to analyze our traffic. You consent to our cookies if you continue to use our website. To find out more about the cookies we use and how to delete them, see our privacy policy.

  I accept cookies from this site.
Agree
EU Cookie Directive plugin by www.channeldigital.co.uk