fix bit param sizing (resolves #94)

This commit is contained in:
Zachary Snow
2020-06-14 19:45:32 -04:00
parent 12be569742
commit cbe0071e43
3 changed files with 54 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
module Example;
parameter bit P = 0;
initial $display("Example: %b", P);
endmodule
module top;
Example a();
Example #(0) b();
Example #(1) c();
Example #(2) d();
Example #(3) e();
function bit foo;
input bit inp;
return inp ^ 1;
endfunction
initial begin
$display("foo(0) = %b", foo(0));
$display("foo(1) = %b", foo(1));
$display("foo(2) = %b", foo(2));
$display("foo(3) = %b", foo(3));
end
bit x;
assign x = 1;
endmodule
+26
View File
@@ -0,0 +1,26 @@
module Example;
parameter [0:0] P = 0;
initial $display("Example: %b", P);
endmodule
module top;
Example a();
Example #(0) b();
Example #(1) c();
Example #(2) d();
Example #(3) e();
function [0:0] foo;
input [0:0] inp;
foo = inp ^ 1;
endfunction
initial begin
$display("foo(0) = %b", foo(0));
$display("foo(1) = %b", foo(1));
$display("foo(2) = %b", foo(2));
$display("foo(3) = %b", foo(3));
end
wire x;
assign x = 1;
endmodule