test case fail, 2 numbers exceeded -INF but +ve INF was returned
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 18 Feb 2019 12:08:55 +0000 (12:08 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 18 Feb 2019 12:08:55 +0000 (12:08 +0000)
src/add/fpbase.py
src/add/test_add.py

index e18df3a517933d3759e9367b9aad3192ab7417ce..2d2fc29d78955a6d36a804d55ae949d327227fc7 100644 (file)
@@ -319,7 +319,7 @@ class FPBase:
         m.next = next_state
         # if overflow occurs, return inf
         with m.If(z.is_overflowed()):
-            m.d.sync += z.inf(0)
+            m.d.sync += z.inf(z.s)
         with m.Else():
             m.d.sync += z.create(z.s, z.e, z.m)
 
index 9a8ebe971177327dee8b3228390cf1c46f32ba17..8e568526e259d15ef24011098d96cb5ae139d046 100644 (file)
@@ -120,6 +120,7 @@ def run_test(dut, stimulus_a, stimulus_b):
             sys.exit(0)
 
 def testbench(dut):
+    yield from check_case(dut, 0xfe34f995, 0xff5d59ad, 0xff800000)
     yield from check_case(dut, 0x82471f51, 0x243985f, 0x801c3790)
     yield from check_case(dut, 0, 0, 0)
     yield from check_case(dut, 0x40000000, 0xc0000000, 0x00000000)