From ff5df25d28e88a15edee6d72e29c54fe105672e3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 14:32:53 +0100 Subject: [PATCH] add fp cvt 64 to 32 test --- src/ieee754/fcvt/test/fcvt_data_64_32.py | 4 ++++ src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py | 2 +- src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py | 2 +- src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py | 21 +++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/ieee754/fcvt/test/fcvt_data_64_32.py create mode 100644 src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py 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() + -- 2.30.2