add fp cvt 64 to 32 test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 13:32:53 +0000 (14:32 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 13:32:53 +0000 (14:32 +0100)
src/ieee754/fcvt/test/fcvt_data_64_32.py [new file with mode: 0644]
src/ieee754/fcvt/test/test_fcvt_pipe_32_16.py
src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py
src/ieee754/fcvt/test/test_fcvt_pipe_64_32.py [new file with mode: 0644]

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 (file)
index 0000000..db9f23d
--- /dev/null
@@ -0,0 +1,4 @@
+def regressions():
+    yield 0x9885020648d8c0e8,
+    yield 0x9885020648d8c0e8,
+
index 7183a8c944cdcf5cff8c50f1eb19ca4bf579f7fc..3c58d4ac8a7e7fcc2dbd83bf48ab58b700bd61d8 100644 (file)
@@ -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__':
index 8bd001f15a68b3285768c19e3206109572af8081..d046510096c967a2c44d95cb580f2ec994d776f7 100644 (file)
@@ -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 (file)
index 0000000..c0a22fe
--- /dev/null
@@ -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()
+