// a parameterized interface interface vector_if(); parameter data_width = 4; logic [data_width-1:0] in; logic [data_width-1:0] out; modport pt ( input in, output out ); endinterface // a module performing the operation without interfaces module op_m #( parameter io_width = 2 )( input [io_width-1:0] in, output [io_width-1:0] out ); genvar i; generate for(i = 0; i < io_width; i++) begin : op_loop assign out[i] = in[i]; end endgenerate endmodule // a wrapper module with interfaces module op_wrapper #( parameter io_width = 2 )( vector_if.pt io ); op_m #(.io_width(io_width)) op_inst(.in(io.in), .out(io.out)); endmodule // test module instantiating the above module and interface module if_test( input [width-1:0] in, output [width-1:0] out ); localparam width = 8; // create interface with default parameter overriden vector_if #(.data_width(width)) vec_if(); // connect interface nodes assign vec_if.in = in; assign out = vec_if.out; // instantiate module with default parameter overriden op_wrapper #(.io_width(width)) op_wrap_inst(.io(vec_if.pt)); endmodule