Sorry I didn’t asked the question properly.
Previously i was using this example.
EX-1:
TB_TOP:
interface vif;
uvm_config_db#(virtual vif)::set(null,“*”,“virtual_if”,vif);
Test:
uvm_config_db#(virtual vif)::get(this,“”,“virtual_if”,agnt_cfg.vif) //Because i have taken the interface handle in agent config class
uvm_config_db#(agnt_cfg)::set(this,“m_agent.*”,“agent_config”,agnt_cfg) // Setting the Agent config
Driver:
agent_config m_cfg_h;
virtual interface.drv_modport m_if_h;
uvm_config_db#(agnt_cfg)::get(this,“”,“agent_config”,m_cfg_h;)
Connect Phase: m_if_h = m_cfg_h.m_if_h;
In this Example1 its working fine.
But i want to get interface directly from top to my Driver class
EX-2:
TB_TOP:
interface vif;
uvm_config_db#(virtual vif)::set(null,“*”,“virtual_if”,vif);
Driver:
virtual interface.drv_modport m_if_h;
uvm_config_db#(virtual vif)::get(this,“”,“virtual_if”,m_if_h;)
When i am doing this i got the error like “You cannot assign the interface(Type mismatching)”.
I have done the same thing in the above example. But there is a handle in agent config through that i am assigning.
But When i am doing directly i am facing the problem.
From the answer of arun kumar i have got that, We cannot assign directly to the drv_modport, We need to get whole interface first after that by taking another handle we can assign the interface to the particular modport.
Am i correct or wrong please give me your Comments/Suggestions.
Thank you very much to all of you for spending your valuable time.