add fpdiv 16/32 regression/coverage tests
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 23 Jul 2019 07:10:55 +0000 (08:10 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 23 Jul 2019 07:10:55 +0000 (08:10 +0100)
src/ieee754/fpdiv/test/div_data16.py [new file with mode: 0644]
src/ieee754/fpdiv/test/test_fpdiv_pipe_16.py [new file with mode: 0644]
src/ieee754/fpdiv/test/test_fpdiv_pipe_32.py

diff --git a/src/ieee754/fpdiv/test/div_data16.py b/src/ieee754/fpdiv/test/div_data16.py
new file mode 100644 (file)
index 0000000..6705635
--- /dev/null
@@ -0,0 +1,3 @@
+def regressions():
+    yield  0x3c50, 0x3e00,
+    yield  0x3c00, 0x3e00,
diff --git a/src/ieee754/fpdiv/test/test_fpdiv_pipe_16.py b/src/ieee754/fpdiv/test/test_fpdiv_pipe_16.py
new file mode 100644 (file)
index 0000000..b6ba0e2
--- /dev/null
@@ -0,0 +1,18 @@
+""" test of FPDIVMuxInOut
+"""
+
+from ieee754.fpdiv.pipeline import (FPDIVMuxInOut,)
+from ieee754.fpcommon.test.case_gen import run_pipe_fp
+from ieee754.fpcommon.test import unit_test_half
+from ieee754.fpdiv.test.div_data16 import regressions
+
+from sfpy import Float16
+from operator import truediv as div
+
+def test_pipe_fp16():
+    dut = FPDIVMuxInOut(16, 4)
+    run_pipe_fp(dut, 16, "div16", unit_test_half, Float16,
+                   regressions, div, 10)
+
+if __name__ == '__main__':
+    test_pipe_fp16()
index e07ffc438ba1db33b0e4d82af7f3c59c76c1c080..ddebfbce24b66fc724099204e320cf8e08269f9d 100644 (file)
@@ -11,7 +11,7 @@ from operator import truediv as div
 
 def test_pipe_fp32():
     dut = FPDIVMuxInOut(32, 4)
-    run_pipe_fp(dut, 32, "div", unit_test_single, Float32,
+    run_pipe_fp(dut, 32, "div32", unit_test_single, Float32,
                    regressions, div, 10)
 
 if __name__ == '__main__':