From 1dd95cf9495195b77ea53df93319143ea2fd53e9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 18 Jul 2019 14:45:01 +0100 Subject: [PATCH] add ui64 to f32 conversion test --- src/ieee754/fcvt/test/test_fcvt_int_pipe.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ieee754/fcvt/test/test_fcvt_int_pipe.py b/src/ieee754/fcvt/test/test_fcvt_int_pipe.py index fc44458e..29a7355c 100644 --- a/src/ieee754/fcvt/test/test_fcvt_int_pipe.py +++ b/src/ieee754/fcvt/test/test_fcvt_int_pipe.py @@ -22,6 +22,9 @@ def fcvt_64(x): def fcvt_32(x): return sfpy.float.ui32_to_f32(x) +def fcvt_64_to_32(x): + return sfpy.float.ui64_to_f32(x) + def fcvt_16(x): return sfpy.float.ui32_to_f16(x) @@ -42,6 +45,14 @@ def test_int_pipe_ui32_f64(): runfp(dut, 32, "test_fcvt_int_pipe_ui32_64", to_uint32, fcvt_64, True, n_vals=100) +def test_int_pipe_ui64_f32(): + # ok, doing 33 bits here because it's pretty pointless (not entirely) + # to do random numbers statistically likely 99.999% of the time to be + # converted to Inf + dut = FPCVTIntMuxInOut(64, 32, 4) + runfp(dut, 33, "test_fcvt_int_pipe_ui64_32", to_uint64, fcvt_64_to_32, True, + n_vals=100) + def test_int_pipe_ui64_f16(): # ok, doing 17 bits here because it's pretty pointless (not entirely) # to do random numbers statistically likely 99.999% of the time to be @@ -60,6 +71,7 @@ def test_int_pipe_ui32_f16(): if __name__ == '__main__': for i in range(200): + test_int_pipe_ui64_f32() test_int_pipe_ui32_f16() test_int_pipe_ui64_f16() test_int_pipe_ui16_f32() -- 2.30.2