Pages

Sunday 13 October 2013

Dear Readers

Please feel free to email me and all suggestions/feedback is welcome to make this small effort better.

Lets examine the basic structure of a UVM component and see how it looks like ,hope you find it useful.

The basic building items of a UVM component are as follows bounded between class, endclass keywords as below


class my_component extends uvm_component


1)factory registration
2)external interfaces
3)Internal component handles
4)Boiler plate code
5)Standard phase methods (which we have discussed in the previous blog)

endcomponent 

Let us discuss at these things one by one, this is NOT a clean compile example but can be used for writing UVM TB components

********************************************************************************

class my_component extends uvm_component;

// We need to use uvm_component_utils as uvm_object_utils is NOT used for 
//TB components .uvm_object_utils is used in stimulus generation part
//Factory registration 
`uvm_component_utils(my_component)
//external interfaces
virtual dut_if dut_ifs;
//Internal component handles
        monitor mon;
        driver drv;
//Boiler plate code start
//Boiler plate code which is mandatory for all UVM TB components
 function new(string name, uvm_component parent);
         super.new(name, parent);
//Boiler plate code end 
     endfunction

//Standard Phase methods
 function void build();
         uvm_report_info(get_full_name(),"Build", UVM_LOW);
            endfunction

     function void connect();
         uvm_report_info(get_full_name(),"Connect", UVM_LOW);
     endfunction

     function void end_of_elaboration();
         uvm_report_info(get_full_name(),"End_of_elaboration", UVM_LOW);
     endfunction

     function void start_of_simulation();
         uvm_report_info(get_full_name(),"Start_of_simulation", UVM_LOW);
     endfunction

     task run();
         uvm_report_info(get_full_name(),"Run", UVM_LOW);
     endtask

     function void extract();
         uvm_report_info(get_full_name(),"Extract", UVM_LOW);
     endfunction

     function void check();
         uvm_report_info(get_full_name(),"Check", UVM_LOW);
     endfunction

     function void report();
         uvm_report_info(get_full_name(),"Report", UVM_LOW);
     endfunction

endclass
*********************************************************************************

-Happy Reading
Hash

No comments:

Post a Comment