Hi,
Can we use bind for an interface with virtual handle?
For example, below code reports error due to : i_tb.tb_inf = i_inf1;
/
/------------------------------
interface test_inf(output logic[17:0] odata,input bit idata);
always @(idata or odata) $display("%0t :: %m :: idata=%0d odata=%0h",$time,idata,odata);
endinterface : test_inf
//------------------------------
interface intf_bind(output logic[17:0] odata,input bit idata);
initial begin
wait(idata ==1); force odata ='h7FFFF;
end
endinterface : intf_bind
//------------------------------
class tb_class;
virtual test_inf tb_inf;
endclass
//------------------------------
module top;
bit idata[2];
logic [17:0] odata[2];
test_inf i_inf1(odata[0],idata[0]);
test_inf i_inf2(odata[1],idata[1]);
bind test_inf:i_inf1 intf_bind i_bind(odata,idata);
initial #10 idata[0]=1;
initial begin
tb_class i_tb = new();
i_tb.tb_inf = i_inf1;
#500 $finish;
end
endmodule : top
**Error observed :
**Error-[ICTA] Incompatible complex type
testbench.sv, 34
Incompatible complex type assignment
Type of source expression is incompatible with type of target expression.
Mismatching types cannot be used in assignments, initializations and
instantiations. The type of the target is ‘virtual interface test_inf’,
while the type of the source is ‘interface test_inf’.
Source Expression: top.i_inf1