Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add floatDivSqrt and its test #36

Closed
wants to merge 109 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
d6ef312
add SqureRoot
midnighter95 Jul 26, 2023
78613f9
fix for 24bits input
midnighter95 Jul 26, 2023
aad7b8f
example case passed
midnighter95 Jul 31, 2023
d5a0fb7
sqrt for FP32 done
midnighter95 Jul 31, 2023
6de8d03
add doc
midnighter95 Jul 31, 2023
9df6f44
update doc
midnighter95 Jul 31, 2023
9dac34a
update doc, reformat and opimization
midnighter95 Aug 1, 2023
823a7c6
fix sqrt QDS table
midnighter95 Aug 2, 2023
ec29b78
opt sqrt io
midnighter95 Aug 2, 2023
f6f8d6c
add sqrtfloat module
midnighter95 Aug 3, 2023
126fa71
[sqrtfloat] add sqrtfloattester
midnighter95 Aug 7, 2023
cbd5303
[sqrtfloat] add rounding Unit
midnighter95 Aug 7, 2023
f1cf890
[sqrtfloat] add rounding Unit
midnighter95 Aug 7, 2023
0d2cc84
[sqrtfloat] add exceptions in RoundingUnit
midnighter95 Aug 7, 2023
7bd2109
format and doc
midnighter95 Aug 1, 2023
aa2f402
decrease Reg Width for partialSum and Carry by 2
midnighter95 Aug 1, 2023
3dc4c32
rename SRT4/8Test to SRT4/8IntegerTest
midnighter95 Aug 1, 2023
085e089
add SRT4FracTest
midnighter95 Aug 2, 2023
1e28711
[div] add SRT16FracTester
midnighter95 Aug 7, 2023
966857a
[sqrtfloat] reduce rbits to 2
midnighter95 Aug 7, 2023
39c0220
[divfloat] move exp bias logic to RoundingUnit
midnighter95 Aug 8, 2023
c51c5d2
[divfloat] add DivFloat and tester
midnighter95 Aug 8, 2023
13dc237
[divfloat] fix divfloat
midnighter95 Aug 8, 2023
e344736
[sqrtfloat] fix io
midnighter95 Aug 8, 2023
feadb87
[sqrtfloat] fix sqrtfloat
midnighter95 Aug 8, 2023
ca7b466
[divsqrt] add divsqrt except exceptions
midnighter95 Aug 9, 2023
7df1e1c
[divsqrt] support exceptions
midnighter95 Aug 9, 2023
3df7343
[divsqrt] tiny fix
midnighter95 Aug 11, 2023
6de5875
tiny fix
midnighter95 Aug 11, 2023
003d93f
[divsqrt] rename some val
midnighter95 Aug 14, 2023
cdbf0a5
add roundingMode intput
midnighter95 Aug 22, 2023
3640001
[makefile] add Makefile
midnighter95 Aug 21, 2023
75e468e
[build] add oslib
midnighter95 Aug 21, 2023
dc2d843
[test] add FTest draft
midnighter95 Aug 21, 2023
139ac86
[submodule] switch chisel version
midnighter95 Aug 21, 2023
afa1f64
able to elaborate sv
midnighter95 Aug 22, 2023
eae9fc3
add DivSqrtTester
midnighter95 Aug 22, 2023
3e5f531
[build] add arithmetictest target
midnighter95 Aug 22, 2023
3013a38
[nix] add softfloat and testfloat
midnighter95 Aug 22, 2023
d76fecc
[test] add resources
midnighter95 Aug 22, 2023
69cf5cf
[test] add dut for divsqrt
midnighter95 Aug 22, 2023
1296826
[test] fix dut for divsqrt
midnighter95 Aug 22, 2023
a26f5fe
[test] add FMATester
midnighter95 Aug 22, 2023
263e5b8
[test] sqrt test passed
midnighter95 Aug 23, 2023
38ecd06
[rtl] add rounding expin bits by 1
midnighter95 Aug 23, 2023
4998e33
[rtl] temp
midnighter95 Aug 23, 2023
232b4b2
[test] tmp
midnighter95 Aug 23, 2023
32d5c61
[rtl] fix common_overflowOut
midnighter95 Aug 23, 2023
5c1c6d1
[rtl] fix rbits_div
midnighter95 Aug 23, 2023
2c7b163
[rtl] NaN overide isZero in Rounding
midnighter95 Aug 23, 2023
1337297
[rtl] add underflow case for exp_Bias=0
midnighter95 Aug 23, 2023
4f038a5
[rtl] opt roundingUnit exception case contrl signals
midnighter95 Aug 24, 2023
f521dec
[rtl] tmp
midnighter95 Aug 24, 2023
e487508
[rtl] tmp
midnighter95 Aug 24, 2023
2ccf167
[rtl] tmp
midnighter95 Aug 24, 2023
d2babf9
[rtl] fix overflow detact
midnighter95 Aug 24, 2023
53cdef1
[rtl] focus on exp+126=0 when subnorm
midnighter95 Aug 24, 2023
2cca125
[rtl] remove underflow flag when div exact
midnighter95 Aug 24, 2023
16998a6
[rtl] fix sub guard and sticky bit logic
midnighter95 Aug 24, 2023
58a0ce8
[rtl] fix inexact
midnighter95 Aug 24, 2023
cebbce7
[rtl] fix totalunderflow to 235
midnighter95 Aug 24, 2023
0cd72cc
[rtl] fix neednorm for div
midnighter95 Aug 24, 2023
2655bec
[rtl] fix subnorm exp inc
midnighter95 Aug 24, 2023
8729ccc
[rtl] fix when subnorm dist between 23 and 235
midnighter95 Aug 24, 2023
fcacedb
[rtl] disable notNaN_isSpecialInfOut when NaN
midnighter95 Aug 24, 2023
b7fe0de
[rtl] fix sub_sigInc for RNE and RMM
midnighter95 Aug 25, 2023
4b7bf7e
[doc] add rtl doc
midnighter95 Aug 25, 2023
cd79609
[rtl] opt div neednorm logic when sigB > sigA
midnighter95 Aug 26, 2023
b66f299
[rtl] change RoundingUnit exp type to SInt
midnighter95 Aug 26, 2023
cdba8c0
[rtl] opt rounding subnormal case
midnighter95 Aug 26, 2023
8bc2f36
[rtl] merge sigInc logic in two cases
midnighter95 Aug 26, 2023
9c58ef3
[rtl] rename and format
midnighter95 Aug 26, 2023
5b0b07f
[rtl] rename and format
midnighter95 Aug 27, 2023
e97ac98
[rtl] doc and format
midnighter95 Aug 27, 2023
9a80fd3
[rtl] opt and reformat
midnighter95 Aug 28, 2023
55c1b7e
[doc] add doc to divsqrt
midnighter95 Aug 28, 2023
6677f04
[doc] clean
midnighter95 Aug 28, 2023
bedf206
[doc] add doc for divsqrt
midnighter95 Sep 20, 2023
e96ec7c
[doc] add doc for roundingUnit
midnighter95 Sep 20, 2023
395168e
[build system] remove some ivys
midnighter95 Sep 20, 2023
514b6ab
[reformat] reformat
midnighter95 Sep 20, 2023
16faa9d
[reformat] reformat
midnighter95 Sep 20, 2023
d389ca4
[submodule] bump chisel
midnighter95 Oct 1, 2023
ab500b8
[tests] add dpi framework
midnighter95 Oct 1, 2023
7a2aa69
[tests] basePoke and basePeek
midnighter95 Oct 5, 2023
d1877c5
[tests] opt toDut interfave
midnighter95 Oct 5, 2023
6d25c7a
[tests] build dpiPeekPoke
midnighter95 Oct 5, 2023
086edd2
[submodule] add submodule
midnighter95 Oct 5, 2023
0c76d92
[tests] link softfloat and testfloat
midnighter95 Oct 5, 2023
ed13f23
[tests] add test generator
midnighter95 Oct 5, 2023
3d0f2f7
[tests] opt test io
midnighter95 Oct 5, 2023
35e88a0
[tests] build dpiCheck
midnighter95 Oct 5, 2023
cb3f5b6
add plantform option to build testfloat and softfloat
midnighter95 Oct 8, 2023
d2fb27b
add case number counter
midnighter95 Oct 8, 2023
9f2bd66
add env and mutiple roundingmodes
midnighter95 Oct 8, 2023
5d260c8
add all rounding mode support
midnighter95 Oct 10, 2023
36fbc87
add sqrt support
midnighter95 Oct 10, 2023
6cc9c97
fix op IO width
midnighter95 Oct 10, 2023
efa4b49
finish div and sqrt tests
midnighter95 Oct 10, 2023
fe57998
opt test framwork
midnighter95 Oct 16, 2023
463108f
add condition for dpicheck and dpipoke
midnighter95 Oct 16, 2023
d5481ed
[rtl]opt and doc rtl
midnighter95 Oct 16, 2023
d241b72
[test]reformat test code
midnighter95 Oct 16, 2023
866fda8
[rtl] add isSNaN to rawFLoat
midnighter95 Oct 17, 2023
56a66a9
[rtl] opt sqrt critical path
midnighter95 Oct 18, 2023
05310e7
[rtl] opt RoundingUnit IO
midnighter95 Oct 18, 2023
3abb56b
[rtl] rename RoundingUnit
midnighter95 Oct 18, 2023
23faa64
[test] opt test system
midnighter95 Oct 23, 2023
8429b94
[nix] remove redundent dependencies
midnighter95 Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# mill
out/
run/
# sbt
diplomacy/target/
diplomacy/macros/target/
Expand All @@ -24,4 +25,4 @@ verdiLog
*.out
*.cmd
*.log
*.json
*.json
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "dependencies/chisel"]
path = dependencies/chisel
url = [email protected]:chipsalliance/chisel.git
[submodule "berkeley-testfloat-3"]
path = berkeley-testfloat-3
url = [email protected]:ucb-bar/berkeley-testfloat-3.git
[submodule "berkeley-softfloat-3"]
path = berkeley-softfloat-3
url = [email protected]:ucb-bar/berkeley-softfloat-3.git
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@


init:
git submodule update --init

compile:
mill -i -j 0 arithmetic[5.0.0].compile

run:
mill -i -j 0 arithmetic[5.0.0].run

test:
mill -i -j 0 arithmetictest[5.0.0].run

bsp:
mill -i mill.bsp.BSP/install

clean:
git clean -fd

softfloat:
make -C berkeley-softfloat-3/build/Linux-x86_64-GCC SPECIALIZE_TYPE=RISCV TESTFLOAT_OPTS="-DFLOAT64 -DFLOAT_ROUND_ODD" softfloat.a -j `nproc`
cp berkeley-softfloat-3/build/Linux-x86_64-GCC/softfloat.a run/

testfloat:
make -C berkeley-testfloat-3/build/Linux-x86_64-GCC SPECIALIZE_TYPE=RISCV TESTFLOAT_OPTS="-DFLOAT64 -DFLOAT_ROUND_ODD" testfloat.a -j `nproc`
cp berkeley-testfloat-3/build/Linux-x86_64-GCC/testfloat.a run/

27 changes: 13 additions & 14 deletions arithmetic/src/division/srt/srt16/SRT16.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ class SRT16(
extends Module {
val guardBitWidth = 3
val xLen: Int = dividendWidth + radixLog2 + 1 + guardBitWidth
val wLen: Int = xLen + radixLog2
val ohWidth: Int = 2 * a + 1
val rWidth: Int = 1 + radixLog2 + rTruncateWidth

// IO
val input = IO(Flipped(DecoupledIO(new SRTInput(dividendWidth, dividerWidth, n, 4))))
val output = IO(ValidIO(new SRTOutput(dividerWidth, dividendWidth)))

val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(wLen.W))
val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(xLen.W))
val dividerNext = Wire(UInt(dividerWidth.W))
val counterNext = Wire(UInt(log2Ceil(n).W))
val quotientNext, quotientMinusOneNext = Wire(UInt(n.W))
Expand All @@ -37,8 +36,8 @@ class SRT16(
val isLastCycle, enable: Bool = Wire(Bool())
// State
// because we need a CSA to minimize the critical path
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(wLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(wLen.W), enable)
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(xLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(xLen.W), enable)
val divider = RegEnable(dividerNext, 0.U(dividerWidth.W), enable)
val quotient = RegEnable(quotientNext, 0.U(n.W), enable)
val quotientMinusOne = RegEnable(quotientMinusOneNext, 0.U(n.W), enable)
Expand All @@ -59,9 +58,9 @@ class SRT16(
val remainderNoCorrect: UInt = partialReminderSum + partialReminderCarry
val remainderCorrect: UInt =
partialReminderSum + partialReminderCarry + (divisorExtended << radixLog2)
val needCorrect: Bool = remainderNoCorrect(wLen - 3).asBool
val needCorrect: Bool = remainderNoCorrect(xLen - 1).asBool

output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(wLen - 4, radixLog2 + guardBitWidth)
output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(xLen - 2, radixLog2 + guardBitWidth)
output.bits.quotient := Mux(needCorrect, quotientMinusOne, quotient)

// 5*CSA32 SRT16 <- SRT4 + SRT4*5 /SRT16 -> CSA53+CSA32
Expand All @@ -73,8 +72,8 @@ class SRT16(
case 2 => Fill(radixLog2, 1.U(1.W)) ## ~(divisorExtended << 1)
})
val csa0InWidth = rWidth + radixLog2 + 1
val csaIn1 = leftShift(partialReminderSum, radixLog2).head(csa0InWidth)
val csaIn2 = leftShift(partialReminderCarry, radixLog2).head(csa0InWidth)
val csaIn1 = partialReminderSum.head(csa0InWidth)
val csaIn2 = partialReminderCarry.head(csa0InWidth)

val csa1 = addition.csa.c32(VecInit(csaIn1, csaIn2, dividerMap(0).head(csa0InWidth))) // -2 csain 10bit
val csa2 = addition.csa.c32(VecInit(csaIn1, csaIn2, dividerMap(1).head(csa0InWidth))) // -1
Expand All @@ -87,8 +86,8 @@ class SRT16(
val partialDivider: UInt = dividerNext.head(dTruncateWidth)(dTruncateWidth - 2, 0)
val qdsOH0: UInt =
QDS(rWidth, ohWidth, dTruncateWidth - 1, tables)(
leftShift(partialReminderSum, radixLog2).head(rWidth),
leftShift(partialReminderCarry, radixLog2).head(rWidth),
partialReminderSum.head(rWidth),
partialReminderCarry.head(rWidth),
partialDivider
) // q_j+1 oneHot

Expand Down Expand Up @@ -120,15 +119,15 @@ class SRT16(

val csa0Out = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qds0sign,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qds0sign,
Mux1H(qdsOH0, dividerMap)
)
)
val csa1Out = addition.csa.c32(
VecInit(
leftShift(csa0Out(1), radixLog2).head(wLen - radixLog2),
leftShift(csa0Out(0), radixLog2 + 1).head(wLen - radixLog2 - 1) ## qds1sign,
leftShift(csa0Out(1), radixLog2).head(xLen),
leftShift(csa0Out(0), radixLog2 + 1).head(xLen - 1) ## qds1sign,
Mux1H(qdsOH1, dividerMap)
)
)
Expand Down
43 changes: 21 additions & 22 deletions arithmetic/src/division/srt/srt4/SRT4.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,24 @@ import utils.leftShift
* @param rTruncateWidth TruncateWidth for residual fractional part
*/
class SRT4(
dividendWidth: Int,
dividerWidth: Int,
n: Int, // the longest width
radixLog2: Int = 2,
a: Int = 2,
dTruncateWidth: Int = 4,
rTruncateWidth: Int = 4)
extends Module {
dividendWidth: Int,
dividerWidth: Int,
n: Int, // the longest width
radixLog2: Int = 2,
a: Int = 2,
dTruncateWidth: Int = 4,
rTruncateWidth: Int = 4)
extends Module {
val guardBitWidth = 1

/** width for csa */
val xLen: Int = dividendWidth + radixLog2 + 1 + guardBitWidth
val wLen: Int = xLen + radixLog2
// IO
val input = IO(Flipped(DecoupledIO(new SRTInput(dividendWidth, dividerWidth, n, 2))))
val output = IO(ValidIO(new SRTOutput(dividerWidth, dividendWidth)))

//rW[j]
val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(wLen.W))
val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(xLen.W))
val quotientNext, quotientMinusOneNext = Wire(UInt(n.W))
val dividerNext = Wire(UInt(dividerWidth.W))
val counterNext = Wire(UInt(log2Ceil(n).W))
Expand All @@ -55,8 +54,8 @@ class SRT4(

// State
// because we need a CSA to minimize the critical path
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(wLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(wLen.W), enable)
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(xLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(xLen.W), enable)
val divider = RegEnable(dividerNext, 0.U(dividerWidth.W), enable)
val quotient = RegEnable(quotientNext, 0.U(n.W), enable)
val quotientMinusOne = RegEnable(quotientMinusOneNext, 0.U(n.W), enable)
Expand All @@ -80,9 +79,9 @@ class SRT4(
/** partialReminderSum is r*W[j], so remainderCorrect = remainderNoCorrect + r*divisor */
val remainderCorrect: UInt =
partialReminderSum + partialReminderCarry + (divisorExtended << radixLog2)
val needCorrect: Bool = remainderNoCorrect(wLen - 3).asBool
val needCorrect: Bool = remainderNoCorrect(xLen - 1).asBool

output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(wLen - 4, radixLog2 + guardBitWidth)
output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(xLen - 2, radixLog2 + guardBitWidth)
output.bits.quotient := Mux(needCorrect, quotientMinusOne, quotient)

/** width for truncated y */
Expand All @@ -97,8 +96,8 @@ class SRT4(
/** QDS module whose output needs to be decoded */
val selectedQuotientOH: UInt =
QDS(rWidth, ohWidth, dTruncateWidth - 1, tables, a)(
leftShift(partialReminderSum, radixLog2).head(rWidth),
leftShift(partialReminderCarry, radixLog2).head(rWidth),
partialReminderSum.head(rWidth),
partialReminderCarry.head(rWidth),
dividerNext.head(dTruncateWidth)(dTruncateWidth - 2, 0) //.1********* -> 1*** -> ***
)
// On-The-Fly conversion
Expand All @@ -120,8 +119,8 @@ class SRT4(

addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qdsSign,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qdsSign,
Mux1H(selectedQuotientOH, dividerMap)
)
)
Expand All @@ -144,15 +143,15 @@ class SRT4(
})
val csa0 = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qds0Sign,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qds0Sign,
Mux1H(qHigh, dividerHMap)
)
)
addition.csa.c32(
VecInit(
csa0(1).head(wLen - radixLog2),
leftShift(csa0(0), 1).head(wLen - radixLog2 - 1) ## qds1Sign,
csa0(1).head(xLen),
leftShift(csa0(0), 1).head(xLen - 1) ## qds1Sign,
Mux1H(qLow, dividerLMap)
)
)
Expand Down
47 changes: 23 additions & 24 deletions arithmetic/src/division/srt/srt8/SRT8.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ class SRT8(

val guardBitWidth = 2
val xLen: Int = dividendWidth + radixLog2 + 1 + guardBitWidth
val wLen: Int = xLen + radixLog2

// IO
val input = IO(Flipped(DecoupledIO(new SRTInput(dividendWidth, dividerWidth, n, 3))))
val output = IO(ValidIO(new SRTOutput(dividerWidth, dividendWidth)))

val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(wLen.W))
val partialReminderCarryNext, partialReminderSumNext = Wire(UInt(xLen.W))
val quotientNext, quotientMinusOneNext = Wire(UInt(n.W))
val dividerNext = Wire(UInt(dividerWidth.W))
val counterNext = Wire(UInt(log2Ceil(n).W))
Expand All @@ -47,8 +46,8 @@ class SRT8(

// State
// because we need a CSA to minimize the critical path
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(wLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(wLen.W), enable)
val partialReminderCarry = RegEnable(partialReminderCarryNext, 0.U(xLen.W), enable)
val partialReminderSum = RegEnable(partialReminderSumNext, 0.U(xLen.W), enable)
val divider = RegEnable(dividerNext, 0.U(dividerWidth.W), enable)
val quotient = RegEnable(quotientNext, 0.U(n.W), enable)
val quotientMinusOne = RegEnable(quotientMinusOneNext, 0.U(n.W), enable)
Expand All @@ -69,8 +68,8 @@ class SRT8(
val remainderNoCorrect: UInt = partialReminderSum + partialReminderCarry
val remainderCorrect: UInt =
partialReminderSum + partialReminderCarry + (divisorExtended << radixLog2)
val needCorrect: Bool = remainderNoCorrect(wLen - 4).asBool
output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(wLen - 5, radixLog2 + guardBitWidth)
val needCorrect: Bool = remainderNoCorrect(xLen - 1).asBool
output.bits.reminder := Mux(needCorrect, remainderCorrect, remainderNoCorrect)(xLen - 2, radixLog2 + guardBitWidth)
output.bits.quotient := Mux(needCorrect, quotientMinusOne, quotient)

val rWidth: Int = 1 + radixLog2 + rTruncateWidth
Expand All @@ -85,8 +84,8 @@ class SRT8(
// qds
val selectedQuotientOH: UInt =
QDS(rWidth, ohWidth, dTruncateWidth - 1, tables, a)(
leftShift(partialReminderSum, radixLog2).head(rWidth),
leftShift(partialReminderCarry, radixLog2).head(rWidth),
partialReminderSum.head(rWidth),
partialReminderCarry.head(rWidth),
dividerNext.head(dTruncateWidth)(dTruncateWidth - 2, 0) //.1********* -> 1*** -> ***
)
// On-The-Fly conversion
Expand Down Expand Up @@ -115,15 +114,15 @@ class SRT8(
})
val csa0 = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qdsSign0,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qdsSign0,
Mux1H(qHigh, dividerHMap)
)
)
val csa1 = addition.csa.c32(
VecInit(
csa0(1).head(wLen - radixLog2),
leftShift(csa0(0), 1).head(wLen - radixLog2 - 1) ## qdsSign1,
csa0(1).head(xLen),
leftShift(csa0(0), 1).head(xLen - 1) ## qdsSign1,
Mux1H(qLow, dividerLMap)
)
)
Expand All @@ -143,15 +142,15 @@ class SRT8(
})
val csa0 = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qdsSign0,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qdsSign0,
Mux1H(qHigh, dividerHMap)
)
)
val csa1 = addition.csa.c32(
VecInit(
csa0(1).head(wLen - radixLog2),
leftShift(csa0(0), 1).head(wLen - radixLog2 - 1) ## qdsSign1,
csa0(1).head(xLen),
leftShift(csa0(0), 1).head(xLen - 1) ## qdsSign1,
Mux1H(qLow, dividerLMap)
)
)
Expand All @@ -171,15 +170,15 @@ class SRT8(
})
val csa0 = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qdsSign0,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qdsSign0,
Mux1H(qHigh, dividerHMap)
)
)
val csa1 = addition.csa.c32(
VecInit(
csa0(1).head(wLen - radixLog2),
leftShift(csa0(0), 1).head(wLen - radixLog2 - 1) ## qdsSign1,
csa0(1).head(xLen),
leftShift(csa0(0), 1).head(xLen - 1) ## qdsSign1,
Mux1H(qLow, dividerLMap)
)
)
Expand All @@ -199,15 +198,15 @@ class SRT8(
})
val csa0 = addition.csa.c32(
VecInit(
leftShift(partialReminderSum, radixLog2).head(wLen - radixLog2),
leftShift(partialReminderCarry, radixLog2).head(wLen - radixLog2 - 1) ## qdsSign0,
partialReminderSum.head(xLen),
partialReminderCarry.head(xLen - 1) ## qdsSign0,
Mux1H(qHigh, dividerHMap)
)
)
val csa1 = addition.csa.c32(
VecInit(
csa0(1).head(wLen - radixLog2),
leftShift(csa0(0), 1).head(wLen - radixLog2 - 1) ## qdsSign1,
csa0(1).head(xLen),
leftShift(csa0(0), 1).head(xLen - 1) ## qdsSign1,
Mux1H(qLow, dividerLMap)
)
)
Expand Down
Loading
Loading