interface_nested_array.sv 501 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
interface Interface;
    logic x;
endinterface

module ModuleC(Interface intf, input y);
    initial $display("ModuleC %b %b", intf.x, y);
endmodule

module ModuleB(Interface intf, input y);
    initial $display("ModuleB %b %b", intf.x, y);
    ModuleC m[2:0] (intf, y);
endmodule

module ModuleA(Interface intf, input y);
    initial $display("ModuleA %b %b", intf.x, y);
    ModuleB m[2:0] (intf, y);
endmodule

module top;
    logic y;
    Interface intf();
    ModuleA m[2:0] (intf, y);
endmodule