clmul finished initial hdl; passes lint

This commit is contained in:
Kevin Kim 2023-02-02 19:49:14 +00:00
parent f07ffbb63b
commit ae5d7844a9

View File

@ -32,21 +32,23 @@
module clmul #(parameter WIDTH=32) ( module clmul #(parameter WIDTH=32) (
input logic [WIDTH-1:0] A, B, // Operands input logic [WIDTH-1:0] A, B, // Operands
output logic [WIDTH-1:0] Result); // ZBS result output logic [WIDTH-1:0] Result); // ZBS result
//output logic [WIDTH-1:0] Sum); // Sum of operands
logic [WIDTH-1] pp [WIDTH-1]; //partial AND products logic [WIDTH-1:0] pp [WIDTH-1:0]; //partial AND products
logic [WIDTH-1] sop; //sum of partial products logic [WIDTH-1:0] sop; //sum of partial products
genvar i;
for (i=0; i<WIDTH;i+=WIDTH) begin:forloop //loop fills partial product array genvar i,j;
for for (i=1; i<WIDTH;i+=WIDTH) begin:outer //loop fills partial product array
//fill partials products here for (j=0;j<i;j++) begin: inner
assign pp[i][j] = A[i]&B[j];
end
end end
genvar i; for (i=1;i<WIDTH;i++) begin:xortree
for (i=1;x<WIDTH;i++) begin:outer assign result[i] = ^pp[i][i:0];
assign result[x] = ^pp[i][i:0]
end end
assign result[0] = A[0]&B[0];
endmodule endmodule