From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 13:32:53 +0000 (+0100) Subject: add fp cvt 64 to 32 test X-Git-Tag: ls180-24jan2020~864 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff5df25d28e88a15edee6d72e29c54fe105672e3;p=ieee754fpu.git add fp cvt 64 to 32 test --- diff --git a/src/ieee754/fcvt/test/fcvt_data_64_32.py b/src/ieee754/fcvt/test/fcvt_data_64_32.py new file mode 100644 index 00000000..db9f23d7 --- /dev/null +++ b/src/ieee754/fcvt/test/fcvt_data_64_32.py @@ -0,0 +1,4 @@ +def regressions(): + yield 0x9885020648d8c0e8, + yield 0x9885020648d8c0e8, + diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py index 7183a8c9..3c58d4ac 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py @@ -13,7 +13,7 @@ def fcvt_16(x): def test_pipe_fp32_16(): dut = FPCVTMuxInOut(32, 16, 4) - run_pipe_fp(dut, 32, "add", unit_test_single, Float32, + run_pipe_fp(dut, 32, "fcvt", unit_test_single, Float32, regressions, fcvt_16, 10, True) if __name__ == '__main__': diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py index 8bd001f1..d0465100 100644 --- a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py @@ -13,7 +13,7 @@ def fcvt_16(x): def test_pipe_fp64_16(): dut = FPCVTMuxInOut(64, 16, 4) - run_pipe_fp(dut, 64, "add", unit_test_single, Float64, + run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64, regressions, fcvt_16, 10, True) if __name__ == '__main__': diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py new file mode 100644 index 00000000..c0a22fea --- /dev/null +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py @@ -0,0 +1,21 @@ +""" test of FPCVTMuxInOut +""" + +from ieee754.fcvt.pipeline import (FPCVTMuxInOut,) +from ieee754.fpcommon.test.case_gen import run_pipe_fp +from ieee754.fpcommon.test import unit_test_single +from ieee754.fcvt.test.fcvt_data_64_32 import regressions + +from sfpy import Float64, Float32 + +def fcvt_32(x): + return Float32(x) + +def test_pipe_fp64_32(): + dut = FPCVTMuxInOut(64, 32, 4) + run_pipe_fp(dut, 64, "fcvt", unit_test_single, Float64, + regressions, fcvt_32, 10, True) + +if __name__ == '__main__': + test_pipe_fp64_32() +