From b4a06a1ee88e2c143a3f29e8a6331b23c36ca9b9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 21:15:03 +0000 Subject: [PATCH] use common run_corner_cases function --- src/add/test_add.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/add/test_add.py b/src/add/test_add.py index 110a5fea..112515b0 100644 --- a/src/add/test_add.py +++ b/src/add/test_add.py @@ -10,7 +10,7 @@ from nmigen_add_experiment import FPADD from unit_test_single import (get_mantissa, get_exponent, get_sign, is_nan, is_inf, is_pos_inf, is_neg_inf, match, get_case, check_case, run_test, - run_edge_cases) + run_edge_cases, run_corner_cases) def testbench(dut): yield from check_case(dut, 0xfe34f995, 0xff5d59ad, 0xff800000) @@ -58,14 +58,7 @@ def testbench(dut): count += len(stimulus_a) print (count, "vectors passed") - #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, add) - count += len(stimulus_a) - print (count, "vectors passed") - + yield from run_corner_cases(dut, count, add) yield from run_edge_cases(dut, count, add) if __name__ == '__main__': -- 2.30.2