8c4726b82378756ef5f488c0e7759a75d9a8690c
1 """ test of FPClassMuxInOut
4 from ieee754
.fclass
.pipeline
import (FPClassMuxInOut
,)
5 from ieee754
.fpcommon
.test
.fpmux
import runfp
6 from ieee754
.fpcommon
.fpbase
import FPFormat
9 from sfpy
import Float64
, Float32
, Float16
13 fmt
= FPFormat
.standard(wid
)
14 print (hex(x
), "exp", fmt
.get_exponent(x
), fmt
.emax
,
15 "m", hex(fmt
.get_mantissa(x
)),
16 fmt
.get_mantissa(x
) & (1<<fmt
.m_width
-1))
27 if fmt
.get_exponent(x
) == fmt
.emax
and fmt
.get_mantissa(x
) != 0:
28 if fmt
.is_nan_signalling(x
):
32 if fmt
.is_subnormal(x
) and fmt
.get_mantissa(x
) != 0:
47 def test_class_pipe_f16():
48 dut
= FPClassMuxInOut(16, 16, 4, op_wid
=1)
49 runfp(dut
, 16, "test_fcvt_class_pipe_f16", Float16
, fclass_16
,
53 if __name__
== '__main__':