Warning issue

in which condition tools give warning : A modport (‘driver’) should not be used in a hierarchical path?

i got warning but i can’t solve it.

In reply to Henriques:

Modports should only be used in interface port and virtual interface declarations. You should not use reference individual interface items.

Is this warning coming when you connect some module with individual signals of modport? Just connect entire modport of the interface, instead of individual signals.

In reply to sharvil111:
Hi Sharvil,
i used modport like this.

interface intf;
logic a;
modport drv(output a)
endinterface

class driver;
virtual interface intf it;
it.drv.a <=0;
endclass

In reply to Henriques:
Unfortunately you do not use the modport. You are only defining a modport.
Using the modport looks like this:

interface intf;
  logic a;
  modport drv(output a)
endinterface

class driver;
  virtual interface intf.drv it;
  it.drv.a <=0;
endclass

You have to make sure that you are declaring and passing the right modport to/from the config_db-

In reply to chr_sue:

Hi chr_sue
I did set and get interface like this ,till same issue.
interface intf;
logic a;
modport drv(output a)
endinterface

class driver;
virtual interface intf.drv it;
if(!uvm_config_db#(virtual mem_if)::get(this, “”, “vif”, vif))
`uvm_fatal(“NO_VIF”,{“virtual interface must be set for: “,get_full_name(),”.vif”});

it.drv.a <=0;
endclass
module top;
initial
uvm_config_db#(virtual mem_if)::set(uvm_root::get(),“*”,“vif”,intf);

In reply to Henriques:

That is correct. Your type definition in the config_db commands is incomplete. You have to add the modport:

uvm_config_db#(virtual mem_if.drv)::set(null,"*","vif",intf);

For the get you have to do the same.