3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

More fixes for bugs found using xsthammer

This commit is contained in:
Clifford Wolf 2013-06-13 11:18:45 +02:00
parent b1d39aa865
commit 0c6ffc4c65
5 changed files with 24 additions and 16 deletions

View file

@ -41,17 +41,16 @@ parameter Y_WIDTH = 1;
input [A_WIDTH-1:0] A;
output [Y_WIDTH-1:0] Y;
wire [Y_WIDTH-1:0] A_buf;
\$pos #(.A_SIGNED(A_SIGNED), .A_WIDTH(A_WIDTH), .Y_WIDTH(Y_WIDTH)) A_conv (.A(A), .Y(A_buf));
genvar i;
generate
for (i = 0; i < Y_WIDTH; i = i + 1) begin:V
if (i < A_WIDTH) begin
\$_INV_ gate (
.A(A[i]),
.Y(Y[i])
);
end else begin
assign Y[i] = 0;
end
\$_INV_ gate (
.A(A_buf[i]),
.Y(Y[i])
);
end
endgenerate