From 6f0924705ac4651213190318596e235be55bde81 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 14:29:24 +0100 Subject: [PATCH] add fp cvt 64-16 test --- src/ieee754/fcvt/test/fcvt_data_64_16.py | 4 ++++ src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/ieee754/fcvt/test/fcvt_data_64_16.py create mode 100644 src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py diff --git a/src/ieee754/fcvt/test/fcvt_data_64_16.py b/src/ieee754/fcvt/test/fcvt_data_64_16.py new file mode 100644 index 00000000..db9f23d7 --- /dev/null +++ b/src/ieee754/fcvt/test/fcvt_data_64_16.py @@ -0,0 +1,4 @@ +def regressions(): + yield 0x9885020648d8c0e8, + yield 0x9885020648d8c0e8, + diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py new file mode 100644 index 00000000..8bd001f1 --- /dev/null +++ b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.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_16 import regressions + +from sfpy import Float64, Float16 + +def fcvt_16(x): + return Float16(x) + +def test_pipe_fp64_16(): + dut = FPCVTMuxInOut(64, 16, 4) + run_pipe_fp(dut, 64, "add", unit_test_single, Float64, + regressions, fcvt_16, 10, True) + +if __name__ == '__main__': + test_pipe_fp64_16() + -- 2.30.2