single_op=False,
opcode=None):
pc = PipeFPCase(dut, name, mod, fmod, width, fpfn, count, single_op, opcode)
- pc.run_regressions(regressions)
+ if regressions:
+ pc.run_regressions(regressions)
pc.run_cornercases()
pc.run("rand1", get_rand1)
pc.run("n127", get_n127)
--- /dev/null
+def regressions():
+ yield 0x3f2ad8eb,
+ yield 0,
+
--- /dev/null
+""" 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_single
+from ieee754.fpdiv.test.sqrt_data32 import regressions
+from ieee754.div_rem_sqrt_rsqrt.core import DivPipeCoreOperation
+
+import unittest
+from sfpy import Float32
+
+
+def sqrt(x):
+ return x.sqrt()
+
+
+class TestDivPipe(unittest.TestCase):
+ def test_pipe_sqrt_fp32(self):
+ dut = FPDIVMuxInOut(32, 4)
+ # don't forget to initialize opcode; don't use magic numbers
+ opcode = int(DivPipeCoreOperation.SqrtRem)
+ run_pipe_fp(dut, 32, "sqrt32", unit_test_single, Float32, regressions,
+ sqrt, 100, single_op=True, opcode=opcode)
+
+if __name__ == '__main__':
+ unittest.main()
--- /dev/null
+""" 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_double
+#from ieee754.fpdiv.test.sqrt_data64 import regressions
+from ieee754.div_rem_sqrt_rsqrt.core import DivPipeCoreOperation
+
+import unittest
+from sfpy import Float64
+
+
+def sqrt(x):
+ return x.sqrt()
+
+
+class TestDivPipe(unittest.TestCase):
+ def test_pipe_sqrt_fp64(self):
+ dut = FPDIVMuxInOut(64, 4)
+ # don't forget to initialize opcode; don't use magic numbers
+ opcode = int(DivPipeCoreOperation.SqrtRem)
+ run_pipe_fp(dut, 64, "sqrt64", unit_test_double, Float64, None,
+ sqrt, 100, single_op=True, opcode=opcode)
+
+if __name__ == '__main__':
+ unittest.main()