From 446b5fa83fe54c12e2a9ec024af8f415032e4190 Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 10 Jan 2023 11:14:59 -0800 Subject: [PATCH] Division constant cleanup --- pipelined/config/shared/wally-constants.vh | 2 +- pipelined/config/shared/wally-shared.vh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pipelined/config/shared/wally-constants.vh b/pipelined/config/shared/wally-constants.vh index 6b66b3ed9..750080498 100644 --- a/pipelined/config/shared/wally-constants.vh +++ b/pipelined/config/shared/wally-constants.vh @@ -132,7 +132,7 @@ // division constants `define DIVN (((`NF<`XLEN) & `IDIV_ON_FPU) ? `XLEN : `NF+2) // standard length of input -`define LOGR (`RADIX==2 ? 32'h1 : 32'h2) // r = log(R) +`define LOGR ($clog2(`RADIX)) // r = log(R) `define RK (`LOGR*`DIVCOPIES) // r*k used for intdiv preproc `define LOGRK ($clog2(`RK)) // log2(r*k) `define FPDUR ((`DIVN+1+(`LOGR*`DIVCOPIES))/(`LOGR*`DIVCOPIES)+(`RADIX/4)) diff --git a/pipelined/config/shared/wally-shared.vh b/pipelined/config/shared/wally-shared.vh index 18f023174..1e961c64a 100644 --- a/pipelined/config/shared/wally-shared.vh +++ b/pipelined/config/shared/wally-shared.vh @@ -23,8 +23,8 @@ /////////////////////////////////////////// // division constants -`define RADIX 32'h2 -`define DIVCOPIES 32'h1 +`define RADIX 32'h4 +`define DIVCOPIES 32'h4 // Memory synthesis configuration `define USE_SRAM 0