Agent definition using UVM

 Agent is defined to make sure all the active and passive component elements are bundled in one group.

which means the components like sequencer,driver are part of active elements and monitor, scoreboard, functional coverage are part of passive elements.

  • Need to Bundle them together in an agent defined using "uvm_agent" library
e.g

class  tx_agent extends uvm_agent;
     
 `uvm_component_utils (tx_agent)
 
   function new (string name = "tx_agent", uvm_component parent);
           super.new (name, parent);
   endfunction

  //  define the handle for driver, monitor and sequencer

         tx_driver          drv;
         tx_monitor         mon;
         tx_sequencer       sqr;

 //  build driver, monitor and sequencer  using factory  definition

       virtual function void  build_phase (uvm_phase phase);
          drv  =  tx_driver :: type_id :: create ("drv", this);
          sqr  =  tx_sequencer :: type_id :: create("sqr", this);
          mon = tx_monitor  :: type_id :: create("mon", this);
       endfunction

  // Need to establish link between sequencer and driver for trasmitting the stimuli

      virtual function void connect_phase (uvm_phase phase);
         drv.seq_item_port.connect(sqr.seq_item_export);
      endfunction
endclass


Comments

Popular posts from this blog

How to define Packages using UVM

How to Run the test using UVM