From 2c6c3e799d3282dc4624039897da5a43230f8b13 Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 30 Dec 2022 07:00:48 -0800 Subject: [PATCH] Clean up sqrt preproc --- pipelined/src/fpu/fdivsqrt/fdivsqrtpreproc.sv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelined/src/fpu/fdivsqrt/fdivsqrtpreproc.sv b/pipelined/src/fpu/fdivsqrt/fdivsqrtpreproc.sv index e56456742..63d391ae9 100644 --- a/pipelined/src/fpu/fdivsqrt/fdivsqrtpreproc.sv +++ b/pipelined/src/fpu/fdivsqrt/fdivsqrtpreproc.sv @@ -104,7 +104,7 @@ module fdivsqrtpreproc ( assign p = ALTBE ? '0 : ZeroDiff; /* verilator lint_off WIDTH */ - // right shift amount to complete in discrete number of steps + // calculate number of cycles nE right shift amount RightShiftX to complete in discrete number of steps assign pPlusr = `LOGR + p; assign pPrTrunc = pPlusr % `RK; assign pPrCeil = (pPlusr >> `LOGRK) + |pPrTrunc; @@ -145,6 +145,7 @@ module fdivsqrtpreproc ( assign DPreproc = IFNormLenD << (mE + {{`DIVBLEN{1'b0}}, 1'b1}); // append leading 1 (for nonzero inputs) and zero-extend + // *** explain this next line assign PreSqrtX = (Xe[0]^ell[0]) ? {1'b0, ~NumZeroE, XPreproc[`DIVb-1:1]} : {~NumZeroE, XPreproc}; // Bottom bit of XPreproc is always zero because DIVb is larger than XLEN and NF assign DivX = {3'b000, ~NumZeroE, XPreproc}; // Sqrt is initialized after a first step of R(X-1), which depends on Radix