summaryrefslogtreecommitdiff
path: root/techlibs/stdcells.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-06-13 11:18:45 +0200
committerClifford Wolf <clifford@clifford.at>2013-06-13 11:18:45 +0200
commit0c6ffc4c656de69c92727580cd4c192211d10e6d (patch)
tree9ad133c4d71f687f1046692e1a80481d3d114a89 /techlibs/stdcells.v
parentb1d39aa8656f8440eb748fbc7b5673d2129a2308 (diff)
More fixes for bugs found using xsthammer
Diffstat (limited to 'techlibs/stdcells.v')
-rw-r--r--techlibs/stdcells.v15
1 files changed, 7 insertions, 8 deletions
diff --git a/techlibs/stdcells.v b/techlibs/stdcells.v
index 41e20214..59209f9b 100644
--- a/techlibs/stdcells.v
+++ b/techlibs/stdcells.v
@@ -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