1 """ test of FPDIVMuxInOut
4 from ieee754
.fpdiv
.pipeline
import (FPDIVMuxInOut
,)
5 from ieee754
.fpcommon
.test
.fpmux
import runfp
6 from ieee754
.div_rem_sqrt_rsqrt
.core
import DivPipeCoreOperation
9 from sfpy
import Float64
, Float32
, Float16
16 class TestDivPipe(unittest
.TestCase
):
17 def test_pipe_sqrt_fp16(self
):
18 dut
= FPDIVMuxInOut(16, 4)
19 # don't forget to initialize opcode; don't use magic numbers
20 opcode
= int(DivPipeCoreOperation
.SqrtRem
)
21 runfp(dut
, 16, "test_fpsqrt_pipe_fp16", Float16
, sqrt
,
22 single_op
=True, opcode
=opcode
, n_vals
=100)
24 def test_pipe_sqrt_fp32(self
):
25 dut
= FPDIVMuxInOut(32, 4)
26 # don't forget to initialize opcode; don't use magic numbers
27 opcode
= int(DivPipeCoreOperation
.SqrtRem
)
28 runfp(dut
, 32, "test_fpsqrt_pipe_fp32", Float32
, sqrt
,
29 single_op
=True, opcode
=opcode
, n_vals
=100)
31 def test_pipe_sqrt_fp64(self
):
32 dut
= FPDIVMuxInOut(64, 4)
33 # don't forget to initialize opcode; don't use magic numbers
34 opcode
= int(DivPipeCoreOperation
.SqrtRem
)
35 runfp(dut
, 64, "test_fpsqrt_pipe_fp64", Float64
, sqrt
,
36 single_op
=True, opcode
=opcode
, n_vals
=100)
39 if __name__
== '__main__':