add CR0 regression, expected 0b10 actual 0b11
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 25 Jul 2020 15:32:22 +0000 (16:32 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 25 Jul 2020 15:32:22 +0000 (16:32 +0100)
src/soc/fu/div/test/test_pipe_caller.py

index 919c1859916f01a01b1d4954ba52fd5536ac962e..58e5646f591299d7fbdcc5db155aa7f6a41cf249 100644 (file)
@@ -103,7 +103,7 @@ class DivTestCases(unittest.TestCase):
         with Program(lst, bigendian) as prog:
             self.run_test_program(prog, initial_regs)
 
-    def test_8_regression(self):
+    def test_8_fsm_regression(self): # FSM result is "36" not 6
         lst = ["divwu. 3, 1, 2"]
         initial_regs = [0] * 32
         initial_regs[1] = 18
@@ -111,6 +111,14 @@ class DivTestCases(unittest.TestCase):
         with Program(lst, bigendian) as prog:
             self.run_test_program(prog, initial_regs)
 
+    def test_9_regression(self): # CR0 fails: expected 0b10, actual 0b11
+        lst = ["divw. 3, 1, 2"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 1
+        initial_regs[2] = 0
+        with Program(lst, bigendian) as prog:
+            self.run_test_program(prog, initial_regs)
+
     def test_divw_by_zero_1(self):
         lst = ["divw. 3, 1, 2"]
         initial_regs = [0] * 32