diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index f07b3f2210e..103115e26dc 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -1234,22 +1234,22 @@ parameter C_SIGNED = 1'bx; function integer sum_widths1; input [(16*NPRODUCTS)-1:0] widths; - int i; + integer i; sum_widths1 = 0; begin for (i = 0; i < NPRODUCTS; i++) begin - sum_widths1 += widths[16*i+:16]; + sum_widths1 = sum_widths1 + widths[16*i+:16]; end end endfunction function integer sum_widths2; input [(16*NADDENDS)-1:0] widths; - int i; + integer i; sum_widths2 = 0; begin for (i = 0; i < NADDENDS; i++) begin - sum_widths2 += widths[16*i+:16]; + sum_widths2 = sum_widths2 + widths[16*i+:16]; end end endfunction @@ -1286,15 +1286,15 @@ always @* begin oper_b[j] = oper_b[j - 1]; end - product = A[ai +: aw] * B[bi +: bw]; + product = oper_a * oper_b; if (PRODUCT_NEGATED[i]) Y = Y - product; else Y = Y + product; - ai += aw; - bi += bw; + ai = ai + aw; + bi = bi + bw; end ci = 0; @@ -1315,7 +1315,7 @@ always @* begin else Y = Y + addend; - ci += cw; + ci = ci + cw; end end