From 1306e14b992955bee5c86fd11149d40bd4fa3bd6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 12:26:00 +0100 Subject: [PATCH] add test fp64 --- src/ieee754/fpadd/test/add_data64.py | 8 ++++++++ src/ieee754/fpadd/test/test_fpadd_pipe_64.py | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/ieee754/fpadd/test/add_data64.py create mode 100644 src/ieee754/fpadd/test/test_fpadd_pipe_64.py diff --git a/src/ieee754/fpadd/test/add_data64.py b/src/ieee754/fpadd/test/add_data64.py new file mode 100644 index 00000000..224794e9 --- /dev/null +++ b/src/ieee754/fpadd/test/add_data64.py @@ -0,0 +1,8 @@ +def regressions(): + yield 0, 0 + yield 0x3FF0000000000000, 0x4000000000000000 + yield 0x4000000000000000, 0x3FF0000000000000 + yield 0x4056C00000000000, 0x4042800000000000 + yield 0x4056C00000000000, 0x4042EA3D70A3D70A + yield 0x3ff00000000000c5, 0xbd28a404211fb72b + yield 0x7f80000000000000, 0xff80000000000000 diff --git a/src/ieee754/fpadd/test/test_fpadd_pipe_64.py b/src/ieee754/fpadd/test/test_fpadd_pipe_64.py new file mode 100644 index 00000000..872b9604 --- /dev/null +++ b/src/ieee754/fpadd/test/test_fpadd_pipe_64.py @@ -0,0 +1,20 @@ +""" test of FPADDMuxInOut +""" + +from ieee754.fpadd.pipeline import (FPADDMuxInOut,) +from ieee754.fpcommon.test.case_gen import run_pipe_fp +from ieee754.fpcommon.test import unit_test_double +from ieee754.fpadd.test.add_data64 import regressions + +from sfpy import Float64 +from operator import add + + +def test_pipe_fp64(): + dut = FPADDMuxInOut(64, 4) + run_pipe_fp(dut, 64, "add", unit_test_double, Float64, + regressions, add, 10) + + +if __name__ == '__main__': + test_pipe_fp64() -- 2.30.2