Bind interface to the instance of RTL top

Dear Forum,

Please help to make the TB to DUT connection using bind command.

So this is my Top DUT:

module dut_top(
            input                    FPGA_CLK100M_P,
            input                    FPGA_CLK100M_N,
            input                    LOGIC_RESETn, // Active LOW !!!
            input                    CLOCK_PRESENT
               ...                  );

wire fifo_in, fifo_out;

fifo u_TIFIFO (
    .in_dut(fifo_in),
    .out_dut(fifo_out)
);

endmodule

My test-bench only needs to be connected to u_TIFIFO instance of the RTL top.
This is how the interface looks like:

interface itf (
    output reg fifo_in,
    input fifo_out
);
endinterface

And the top module

module top();

wire in,out;

dut_top dutInst ();
itf itfInstncTI (in, out);

tb tbInst (itfInstncTI ); //  here TB drives all the interface signal
bindModule bindInst(in, out);

endmodule

The issue is that I cannot write the binding module. I cannot specify the instance of interface in the bind command

module bindModule(input in, output out);

// for TIFIFO 
bind fifo:top.dutInst.u_TIFIFO itf bindInst (
    .fifo_in(in_dut),
    .fifo_out(out_dut)
);
endmodule

Seems there is no way to bind the interface instance to another instance of RTL top module.
Could you please provide some suggestions how I can resolve this issue.

When you use the ‘bind’ construct, it will create an instance of the interface for you. You do not need to create an instance separately.

Here is a working example:


module fifo(input in_dut, output out_dut);
endmodule

module dut_top(
            input                    FPGA_CLK100M_P,
            input                    FPGA_CLK100M_N,
            input                    LOGIC_RESETn, // Active LOW !!!
            input                    CLOCK_PRESENT
);

wire fifo_in, fifo_out;

fifo u_TIFIFO (
    .in_dut(fifo_in),
    .out_dut(fifo_out)
);

endmodule

interface itf (
    output reg fifo_in,
    input fifo_out
);
endinterface

module tb(itf itf_inst);
endmodule

module top();

wire in,out;

dut_top dutInst ();
itf itfInstncTI (in, out);

bind fifo itf itf_inst(.fifo_in(in_dut),.fifo_out(out_dut)); // bind creates instance of interface inside DUT

tb tbInst (dutInst.u_TIFIFO.itf_inst); //  here TB drives all the interface signal

endmodule

In reply to cgales:

Thank you very much!
It is working

In reply to cgales:

“bind creates instance of interface inside DUT”

Apart from accessing DUT signals hierarchically, what are other applications of creating instance of interface inside DUT ?