1 """ test of FPCVTMuxInOut
4 from ieee754
.fcvt
.pipeline
import (FPCVTIntMuxInOut
,)
5 from ieee754
.fpcommon
.test
.fpmux
import runfp
8 from sfpy
import Float64
, Float32
, Float16
17 return sfpy
.float.ui32_to_f64(x
)
20 return sfpy
.float.ui32_to_f32(x
)
22 def test_int_pipe_fp16_32():
23 dut
= FPCVTIntMuxInOut(16, 32, 4)
24 runfp(dut
, 16, "test_fcvt_int_pipe_fp16_32", to_uint16
, fcvt_32
, True,
27 def test_int_pipe_fp16_64():
28 dut
= FPCVTIntMuxInOut(16, 64, 4)
29 runfp(dut
, 16, "test_fcvt_int_pipe_fp16_64", to_uint16
, fcvt_64
, True,
32 def test_int_pipe_fp32_64():
33 dut
= FPCVTIntMuxInOut(32, 64, 4)
34 runfp(dut
, 32, "test_fcvt_int_pipe_fp32_64", to_uint32
, fcvt_64
, True,
37 if __name__
== '__main__':
39 test_int_pipe_fp16_32()
40 test_int_pipe_fp16_64()
41 test_int_pipe_fp32_64()