In my testbench I have created a interface file
interface intf
logic clk;
logic busy;
logic data;
modport in(input clk,busy,data);
modport out(input clk,output busy,data);
endinterface
In my top module I have instantiated and set the interface in this way
intf if();
initial begin
uvm_config_db#(virtual intf.in)::set(uvm_root::get(), "*", vif_mon,if.in);
uvm_config_db#(virtual intf.out)::set(uvm_root::get(), "*", vif_drv,if.out);
end
And In my driver class I have declared virtual Interface as
virtual intf.out vif;
uvm_config_db#(virtual intf.out)::get(this, *,vif_drv,vif)
And In my monitor class I have declared virtual Interface as
virtual intf.in vif;
uvm_config_db#(virtual intf.in)::get(this, *,vif_mon,vif)
Driver is using OUT modport to drive signals to RTL where as monitor is using IN modport to capture signals from RTL.
What I can see in my testbench is the time driver is asserting ho_busy(Using out modport) at the same time IN modport ho_busy is getting asserted. Because of which my monitor start capturing data.
Is there a way I can pass modport independently to driver and monitor?
cc: @dave_59