add fcvt first version
[ieee754fpu.git] / src / ieee754 / fcvt / test / test_fcvt_pipe.py
1 """ test of FPMULMuxInOut
2 """
3
4 from ieee754.fcvt.pipeline import (FPMULMuxInOut,)
5 from ieee754.fpcommon.test.fpmux import runfp
6
7 from sfpy import Float64, Float32, Float16
8
9 def fcvt_32_16(x):
10 return Float16(x)
11
12 def test_pipe_fp32_16():
13 dut = FPMULMuxInOut(32, 16, 4)
14 runfp(dut, 32, "test_fcvt_pipe_fp32_16", Float32, fcvt_32_16)
15
16 def test_pipe_fp64():
17 dut = FPMULMuxInOut(64, 4)
18 runfp(dut, 64, "test_fcvt_pipe_fp64", Float64, mul)
19
20 if __name__ == '__main__':
21 test_pipe_fp32()
22