add cookie-cut test_fpdiv_pipe.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Jun 2019 05:29:33 +0000 (06:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Jun 2019 05:29:33 +0000 (06:29 +0100)
src/ieee754/fpdiv/test/test_fpdiv_pipe.py [new file with mode: 0644]

diff --git a/src/ieee754/fpdiv/test/test_fpdiv_pipe.py b/src/ieee754/fpdiv/test/test_fpdiv_pipe.py
new file mode 100644 (file)
index 0000000..7f0e120
--- /dev/null
@@ -0,0 +1,25 @@
+""" test of FPDIVMuxInOut
+"""
+
+from ieee754.fpdiv.pipeline import (FPDIVMuxInOut,)
+from ieee754.fpcommon.test.fpmux import runfp
+
+from sfpy import Float64, Float32, Float16
+from operator import div
+
+def test_pipe_fp16():
+    dut = FPDIVMuxInOut(16, 4)
+    runfp(dut, 16, "test_fpdiv_pipe_fp16", Float16, div)
+
+def test_pipe_fp32():
+    dut = FPDIVMuxInOut(32, 4)
+    runfp(dut, 32, "test_fpdiv_pipe_fp32", Float32, div)
+
+def test_pipe_fp64():
+    dut = FPDIVMuxInOut(64, 4)
+    runfp(dut, 64, "test_fpdiv_pipe_fp64", Float64, div)
+
+if __name__ == '__main__':
+    test_pipe_fp16()
+    test_pipe_fp32()
+    test_pipe_fp64()