From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 21:04:29 +0000 (+0000) Subject: add corner case unit test function X-Git-Tag: ls180-24jan2020~1891 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=268fcd9d5ea8cd741d6078a54f99c01d78fd850f;p=ieee754fpu.git add corner case unit test function --- diff --git a/src/add/unit_test_single.py b/src/add/unit_test_single.py index b2396131..a752189f 100644 --- a/src/add/unit_test_single.py +++ b/src/add/unit_test_single.py @@ -114,6 +114,16 @@ def run_test(dut, stimulus_a, stimulus_b, op): sys.exit(0) +def run_corner_cases(dut, count, op): + #corner cases + from itertools import permutations + stimulus_a = [i[0] for i in permutations([0x80000000, 0x00000000, 0x7f800000, 0xff800000, 0x7fc00000, 0xffc00000], 2)] + stimulus_b = [i[1] for i in permutations([0x80000000, 0x00000000, 0x7f800000, 0xff800000, 0x7fc00000, 0xffc00000], 2)] + yield from run_test(dut, stimulus_a, stimulus_b, op) + count += len(stimulus_a) + print (count, "vectors passed") + + def run_edge_cases(dut, count, op): #edge cases stimulus_a = [0x80000000 for i in range(1000)]