How do pass inteface class and configuration class to the test bench environment

I am trying to integrate vip and that has interface and that I have set and using it and there is configuration class and these need to be passed to environment. How can achieve this?

See if this helps:
https://verificationacademy.com/forums/uvm/access-api-module-uvm-driver
It will take you down a rabbit hole but it covers a lot.

In reply to narendravk28:


//Inside the testbench top create the instantiate inside and pass it
  typedef virtual my_interface my_vif;
  my_interface u_intf (clock, resetn);
  
  initial begin
    uvm_config_db#(virtual my_interface)::set(null, "*", "vif", u_intf);
    run_test();
  end

//Inside the driver/monitor 
    if(!uvm_config_db#(virtual my_interface)::get(this, "", "vif", vif)) begin
      	`uvm_error("", "uvm_config_db::get failed")
    end



//you don't need to create the config class inside testbench top and pass
//create config class inside the base test / environment and pass to lower components 

    env_cfg = my_env_cfg::type_id::create("env_cfg");
    uvm_config_db#(my_env_cfg)::set(this, "env*", "env_cfg", env_cfg);

//get the config in lower components 
    if(!uvm_config_db#(my_env_cfg)::get(this, "", "env_cfg", env_cfg)) begin
      	`uvm_error("", "uvm_config_db::get failed")
    end

In reply to Rahulkumar:

Thank you, interface is conventional SET and GET in top and for configuration its via base test class where its created.