interface_func.sv 325 Bytes
Newer Older
1
interface Foo;
2 3
    parameter MULTIPLIER = 7;
    function integer bar;
4
        input integer x;
5
        return x * x * MULTIPLIER;
6 7 8 9
    endfunction
endinterface

module top;
10 11 12 13 14 15
    Foo foo_1();
    Foo #(.MULTIPLIER(8)) foo_2();
    initial begin
        $display(foo_1.bar(3));
        $display(foo_2.bar(3));
    end
16
endmodule