add extra regression tests (a + -a) for add
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 19 Feb 2019 05:41:28 +0000 (05:41 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 19 Feb 2019 05:41:28 +0000 (05:41 +0000)
src/add/test_add.py

index 112515b0c04c79e22d270605b6f07be0c8a2d79a..d97ade8d09858af00e9f1b5f8d3577df76014c55 100644 (file)
@@ -13,6 +13,8 @@ from unit_test_single import (get_mantissa, get_exponent, get_sign, is_nan,
                                 run_edge_cases, run_corner_cases)
 
 def testbench(dut):
+    yield from check_case(dut, 0x42540000, 0xC2540000, 0x00000000)
+    yield from check_case(dut, 0xC2540000, 0x42540000, 0x00000000)
     yield from check_case(dut, 0xfe34f995, 0xff5d59ad, 0xff800000)
     yield from check_case(dut, 0x82471f51, 0x243985f, 0x801c3790)
     yield from check_case(dut, 0, 0, 0)
@@ -52,8 +54,10 @@ def testbench(dut):
     count = 0
 
     #regression tests
-    stimulus_a = [0x22cb525a, 0x40000000, 0x83e73d5c, 0xbf9b1e94, 0x34082401, 0x5e8ef81, 0x5c75da81, 0x2b017]
-    stimulus_b = [0xadd79efa, 0xC0000000, 0x1c800000, 0xc038ed3a, 0xb328cd45, 0x114f3db, 0x2f642a39, 0xff3807ab]
+    stimulus_a = [0x22cb525a, 0x40000000, 0x83e73d5c, 0xbf9b1e94, 0x34082401,
+                    0x5e8ef81, 0x5c75da81, 0x2b017]
+    stimulus_b = [0xadd79efa, 0xC0000000, 0x1c800000, 0xc038ed3a, 0xb328cd45, 
+                    0x114f3db, 0x2f642a39, 0xff3807ab]
     yield from run_test(dut, stimulus_a, stimulus_b, add)
     count += len(stimulus_a)
     print (count, "vectors passed")