lza cleanup

This commit is contained in:
David Harris 2022-08-01 15:43:48 -07:00
parent c3e9719c99
commit f56b26ec40
2 changed files with 7 additions and 7 deletions

View File

@ -84,8 +84,9 @@ module fma(
// ///////////////////////////////////////////////////////////////////////////////
fmaadd add(.Am, .Pm, .Ze, .Pe, .Ps, .As, .KillProd, .ZmSticky, .AmInv, .PmKilled, .NegSum, .InvA, .Sm, .Se, .Ss);
fmalza lza(.A(AmInv), .Pm({PmKilled, 1'b0, InvA&Ps&ZmSticky&KillProd}), .Cin(InvA & ~(ZmSticky & ~KillProd)), .sub(InvA), .SCnt);
fmalza lza(.A(AmInv[3*`NF+5:0]), .Pm({PmKilled, 1'b0, InvA&Ps&ZmSticky&KillProd}), .Cin(InvA & ~(ZmSticky & ~KillProd)), .sub(InvA), .SCnt);
endmodule

View File

@ -30,7 +30,7 @@
`include "wally-config.vh"
module fmalza( // [Schmookler & Nowka, Leading zero anticipation and detection, IEEE Sym. Computer Arithmetic, 2001]
input logic [3*`NF+6:0] A, // addend
input logic [3*`NF+5:0] A, // addend
input logic [2*`NF+3:0] Pm, // product
input logic Cin, // carry in
input logic sub,
@ -45,12 +45,11 @@ module fmalza( // [Schmookler & Nowka, Leading zero anticipation and detection,
assign B = {{(`NF+2){1'b0}}, Pm}; // Zero extend product
assign P = A[WIDTH-2:0]^B[WIDTH-2:0];
assign G = A[WIDTH-2:0]&B[WIDTH-2:0];
assign K= ~A[WIDTH-2:0]&~B[WIDTH-2:0];
assign P = A[WIDTH-2:0]^B;
assign G = A[WIDTH-2:0]&B;
assign K= ~A[WIDTH-2:0]&~B;
assign Pp1 = {sub, P[WIDTH-2:1]};
// assign Pp1 = {A[WIDTH-1], P[WIDTH-2:1]};
assign Gm1 = {G[WIDTH-3:0], Cin};
assign Km1 = {K[WIDTH-3:0], ~Cin};