Skip to content

Commit

Permalink
fixup! macc_v2: Fix language constructs in simlib model
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Jan 24, 2025
1 parent f3a64ab commit 09caae4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions techlibs/common/simlib.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -1315,7 +1315,7 @@ always @* begin
else
Y = Y + addend;

ci += cw;
ci = ci + cw;
end
end

Expand Down

0 comments on commit 09caae4

Please sign in to comment.