Some more sanitization but will pass to legal to determine if okay on version - it is substantially different in some ways but not a legal expert on this

This commit is contained in:
James E. Stine 2021-10-19 12:09:43 -05:00
parent b65a4bd040
commit ed179b0bd9

View File

@ -30,7 +30,8 @@ module mult_cs #(parameter WIDTH = 8)
input logic [WIDTH-1:0] b; input logic [WIDTH-1:0] b;
input logic tc; input logic tc;
output logic [2*WIDTH-1:0] sum, carry; output logic [2*WIDTH-1:0] sum;
output logic [2*WIDTH-1:0] carry;
// PP array // PP array
logic [2*WIDTH-1:0] pp_array [0:WIDTH-1]; logic [2*WIDTH-1:0] pp_array [0:WIDTH-1];
@ -38,18 +39,18 @@ module mult_cs #(parameter WIDTH = 8)
logic [2*WIDTH-1:0] tmp_sum, tmp_carry; logic [2*WIDTH-1:0] tmp_sum, tmp_carry;
logic [2*WIDTH-1:0] temp_pp; logic [2*WIDTH-1:0] temp_pp;
logic [2*WIDTH-1:0] tmp_pp_carry; logic [2*WIDTH-1:0] tmp_pp_carry;
logic [WIDTH-1:0] temp_b_padded; logic [WIDTH-1:0] temp_b;
logic temp_bitgroup; logic temp_bitgroup;
integer bit_pair, height, i; integer bit_pair, height, i;
always_comb always_comb
begin begin
// For each multiplicand // For each multiplicand PP generation
for (bit_pair=0; bit_pair < WIDTH; bit_pair=bit_pair+1) for (bit_pair=0; bit_pair < WIDTH; bit_pair=bit_pair+1)
begin begin
// Shift to the right via P&H // Shift to the right via P&H
temp_b_padded = (b >> (bit_pair)); temp_b = (b >> (bit_pair));
temp_bitgroup = temp_b_padded[0]; temp_bitgroup = temp_b[0];
// PP generation // PP generation
case (temp_bitgroup) case (temp_bitgroup)
1'b0 : temp_pp = {2*WIDTH-1{1'b0}}; 1'b0 : temp_pp = {2*WIDTH-1{1'b0}};
@ -64,7 +65,7 @@ module mult_cs #(parameter WIDTH = 8)
// Height is multiplier // Height is multiplier
height = WIDTH; height = WIDTH;
// Wallace Tree Reduction // Wallace Tree PP reduction
while (height > 2) while (height > 2)
begin begin
for (i=0; i < (height/3); i=i+1) for (i=0; i < (height/3); i=i+1)