From: Luke Kenneth Casson Leighton Date: Fri, 28 Jun 2019 05:29:33 +0000 (+0100) Subject: add cookie-cut test_fpdiv_pipe.py X-Git-Tag: ls180-24jan2020~976 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b159629243d260e3fea363a75a2a6272bbe3bf2;p=ieee754fpu.git add cookie-cut test_fpdiv_pipe.py --- diff --git a/src/ieee754/fpdiv/test/test_fpdiv_pipe.py b/src/ieee754/fpdiv/test/test_fpdiv_pipe.py new file mode 100644 index 00000000..7f0e120a --- /dev/null +++ b/src/ieee754/fpdiv/test/test_fpdiv_pipe.py @@ -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()