Commit 99428b2f by Zachary Snow

expanded support for interfaces with parameters

parent 8cfd05de
interface I;
parameter WIDTH = 32;
logic [WIDTH-1:0] data = 0;
modport P(input data);
endinterface
module M(i);
parameter A = 1;
I.P i;
parameter B = 2;
initial begin
$display("A %b", A);
$display("I.P %b", i.data);
$display("B %b", B);
end
endmodule
module top;
I x();
I #(10) y();
M a(x);
M b(y);
M #(3, 4) c(x);
M #(5, 6) d(y);
endmodule
module M(data);
parameter A = 1;
parameter WIDTH = 32;
parameter B = 2;
input wire [WIDTH-1:0] data;
initial begin
$display("A %b", A);
$display("I.P %b", data);
$display("B %b", B);
end
endmodule
module top;
wire [31:0] x_data = 0;
wire [9:0] y_data = 0;
M #(.WIDTH(32)) a(x_data);
M #(.WIDTH(10)) b(y_data);
M #(3, 32, 4) c(x_data);
M #(5, 10, 6) d(y_data);
endmodule
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment