mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Sanitization some more on mult_cs.sv
This commit is contained in:
parent
d0ab43e4e8
commit
37fe5e56a8
@ -75,24 +75,22 @@ module mult_cs #(parameter WIDTH = 8)
|
|||||||
(pp_array[i*3] & pp_array[i*3+2]);
|
(pp_array[i*3] & pp_array[i*3+2]);
|
||||||
next_pp_array[i*2+1] = tmp_pp_carry << 1;
|
next_pp_array[i*2+1] = tmp_pp_carry << 1;
|
||||||
end
|
end
|
||||||
|
// Reasssign not divisible by 3 rows to next_pp_array
|
||||||
if ((height % 3) > 0)
|
if ((height % 3) > 0)
|
||||||
begin
|
begin
|
||||||
for (i=0; i < (height % 3); i=i+1)
|
for (i=0; i < (height % 3); i=i+1)
|
||||||
next_pp_array[2 * (height/3) + i] = pp_array[3 * (height/3) + i];
|
next_pp_array[2 * (height/3) + i] = pp_array[3 * (height/3) + i];
|
||||||
end
|
end
|
||||||
|
// Put back values in pp_array to start again
|
||||||
for (i=0; i < WIDTH; i=i+1)
|
for (i=0; i < WIDTH; i=i+1)
|
||||||
pp_array[i] = next_pp_array[i];
|
pp_array[i] = next_pp_array[i];
|
||||||
|
// Reduce height
|
||||||
height = height - (height/3);
|
height = height - (height/3);
|
||||||
end
|
end
|
||||||
|
|
||||||
// Sum is first row in reduced array
|
// Sum is first row in reduced array
|
||||||
tmp_sum = pp_array[0];
|
tmp_sum = pp_array[0];
|
||||||
|
|
||||||
// Carry is second row in reduced array
|
// Carry is second row in reduced array
|
||||||
if (height > 1)
|
tmp_carry = pp_array[1];
|
||||||
tmp_carry = pp_array[1];
|
|
||||||
else
|
|
||||||
tmp_carry = {2*WIDTH-1{1'b0}};
|
|
||||||
end
|
end
|
||||||
|
|
||||||
assign sum = tmp_sum;
|
assign sum = tmp_sum;
|
||||||
|
Loading…
Reference in New Issue
Block a user