Advertisement
Sidsh

test.sv

Oct 29th, 2022 (edited)
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class our_test extends uvm_test;        //our_test is child of class of uvm_test
  2.     `uvm_component_utils(our_test)      //this will register our class with the factory
  3.  
  4.     //instantiate classes
  5.         our_env env;                    //initiated the env class we created
  6.  
  7.     //constructor
  8.  
  9.     //build phase
  10.         function void build_phase(uvm_phase phase);
  11.             env = our_env :: type_id :: create("env", this);    //this is we created a new object
  12.         endfunction
  13.  
  14.  
  15.  
  16.  
  17.     //constructor- (a function to create class and initialize class properties)
  18.         function new (string name = "our_test", uvm_component parent = null);
  19.             super.new(name, parent);    //refers to the properties of the parent class(default UVM test class)
  20.         endfunction
  21.  
  22.     //build phase
  23.         function void build_phase(uvm_phase phase);
  24.             //build other components
  25.         endfunction
  26.  
  27.     //connect phase
  28.         function void connect_phase(uvm_phase phase);
  29.             //necessary connections
  30.         endfunction
  31.  
  32.     //runphase
  33.         task run_phase(uvm_phase phase);
  34.             //main logic
  35.         endtask
  36.          
  37. endclass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement