From: Luke Kenneth Casson Leighton Date: Sat, 22 Aug 2020 23:45:28 +0000 (+0100) Subject: add extra div regression tests X-Git-Tag: semi_working_ecp5~272^2~20 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9407c84692ecd62b736f0fc57da2a6b2edde0905;p=soc.git add extra div regression tests --- diff --git a/src/soc/fu/div/test/test_pipe_caller.py b/src/soc/fu/div/test/test_pipe_caller.py index def5c77f..ccd3e1b6 100644 --- a/src/soc/fu/div/test/test_pipe_caller.py +++ b/src/soc/fu/div/test/test_pipe_caller.py @@ -21,6 +21,17 @@ class DivTestCases(TestAccumulatorBase): with Program(lst, bigendian) as prog: self.add_case(prog, initial_regs) + def case_divduo_regression(self): + lst = [f"divduo. 11, 20, 6"] + initial_regs = [0] * 32 + #gpr: 00ff00ff00ff0080 <- r6 + #gpr: 000000000000007f <- r11 + #gpr: 7f6e5d4c3b2a1908 <- r20 + initial_regs[6] = 0x00ff00ff00ff0080 + initial_regs[20] = 0x7f6e5d4c3b2a1908 + with Program(lst, bigendian) as prog: + self.add_case(prog, initial_regs) + def case_0_regression(self): for i in range(40): lst = ["divwo 3, 1, 2"] @@ -119,6 +130,14 @@ class DivTestCases(TestAccumulatorBase): with Program(lst, bigendian) as prog: self.add_case(prog, initial_regs) + def case_11_regression(self): + lst = ["divwo. 3, 1, 2"] + initial_regs = [0] * 32 + initial_regs[1] = 0xffffffffffffffff + initial_regs[2] = 0xffffffffffffffff + with Program(lst, bigendian) as prog: + self.add_case(prog, initial_regs) + def case_divw_by_zero_1(self): lst = ["divw. 3, 1, 2"] initial_regs = [0] * 32