Config_db set and get method

Well i am having a problem using set and get method. Using set method of config-db a class is set in the interface. the code is:


uvm_config_db#(uvm_object)::set(null,"*", "accessor_drv", drv_acc);

But when i am trying to get that class in the driver class in simulation it is producing a fatal error.


 if(!uvm_config_db#(driver_accessor)::get(this,"","accessor_drv",accessor))begin
      `uvm_fatal("No_accessor",{"Accessor must be set for :",get_full_name(),".accessor"});
    end

In reply to Rana Adeel Ahmad:

The parameterization of uvm_config_db#() needs to match in both set() and get().

In your set(), you have ‘uvm_config_db#(uvm_object)’, but in the get(), you have ‘uvm_config_db#(driver_accessor)’.

In reply to cgales:

But the driver_accessor extends from uvm_object. Does that have no impact.

In reply to Rana Adeel Ahmad:

No. The requirement is that the parameterization is the same for both set() and get().

In reply to cgales:

Thank you so much my issue got resolved.