mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
fdivsqrt parameter cleanup
This commit is contained in:
parent
3cae2385ab
commit
d5ba8fc5e6
@ -93,11 +93,17 @@ localparam NF2 = ((F_SUPPORTED & (LEN1 != S_LEN)) ? S_NF : H_NF);
|
||||
localparam FMT2 = ((F_SUPPORTED & (LEN1 != S_LEN)) ? 2'd0 : 2'd2);
|
||||
localparam BIAS2 = ((F_SUPPORTED & (LEN1 != S_LEN)) ? S_BIAS : H_BIAS);
|
||||
|
||||
// intermediate division parameters not directly used in Divider
|
||||
localparam FPDIVN = NF+3; // length of floating-point inputs: Ns + 2 = Nf + 3 for 1 integer bit, Nf fracitonal bits, 2 extra bits to shift sqrt into [1/4, 1)]
|
||||
localparam DIVN = ((FPDIVN<XLEN) & IDIV_ON_FPU) ? XLEN : FPDIVN+3; // standard length of input: max(XLEN, NF+2) ***
|
||||
|
||||
// division constants
|
||||
localparam DIVN = ((NF+2<XLEN) & IDIV_ON_FPU) ? XLEN : NF+2; // standard length of input: max(XLEN, NF+2)
|
||||
|
||||
// *** define NF+2, justify, use in DIVN
|
||||
localparam LOGR = $clog2(RADIX); // r = log(R)
|
||||
localparam RK = LOGR*DIVCOPIES; // r*k bits per cycle generated
|
||||
localparam FPDUR = (DIVN+1)/RK + 1 + (RADIX/4); // *** relate to algorithm for rest of these
|
||||
//localparam FPDUR = (DIVN+1)/RK + 1 + (RADIX/4); // *** relate to algorithm for rest of these
|
||||
localparam FPDUR = (DIVN+LOGR-1)/RK + 1 ; // ceiling((DIVN+LOGR)/RK)
|
||||
localparam DURLEN = $clog2(FPDUR+1);
|
||||
localparam DIVb = FPDUR*RK - 1; // canonical fdiv size (b)
|
||||
localparam DIVBLEN = $clog2(DIVb+2)-1; // *** where is 2 coming from?
|
||||
|
@ -177,7 +177,6 @@ localparam cvw_t P = '{
|
||||
NORMSHIFTSZ : NORMSHIFTSZ,
|
||||
LOGNORMSHIFTSZ : LOGNORMSHIFTSZ,
|
||||
CORRSHIFTSZ : CORRSHIFTSZ,
|
||||
DIVN : DIVN,
|
||||
LOGR : LOGR,
|
||||
RK : RK,
|
||||
FPDUR : FPDUR,
|
||||
|
@ -269,7 +269,6 @@ typedef struct packed {
|
||||
int CORRSHIFTSZ;
|
||||
|
||||
// division constants
|
||||
int DIVN ;
|
||||
int LOGR ;
|
||||
int RK ;
|
||||
int FPDUR ;
|
||||
|
Loading…
Reference in New Issue
Block a user