Re-enable rlwinm test
authorMichael Nolan <mtnolan2640@gmail.com>
Mon, 11 May 2020 14:23:00 +0000 (10:23 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Mon, 11 May 2020 14:23:00 +0000 (10:23 -0400)
src/soc/alu/test/test_pipe_caller.py
src/soc/decoder/isa/test_caller.py

index d3ec23abe7336f1cde9934077624a1fa02f5e4bd..9d44730d07418f0c254c41f7be8605ce6f69c05e 100644 (file)
@@ -178,7 +178,6 @@ class ALUTestCase(FHDLTestCase):
         with Program(lst) as program:
             sim = self.run_tst_program(program, initial_regs)
 
-    @unittest.skip("broken")
     def test_rlwinm(self):
         for i in range(10):
             mb = random.randint(0,31)
@@ -192,15 +191,13 @@ class ALUTestCase(FHDLTestCase):
 
     @unittest.skip("broken")
     def test_rlwimi(self):
-        lst = ["rlwinm 3, 1, 5, 20, 6",
-               "rlwimi 3, 1, 5, 20, 6"]
+        lst = ["rlwimi 3, 1, 5, 20, 6"]
         initial_regs = [0] * 32
-        initial_regs[1] = random.randint(0, (1<<64)-1)
-        initial_regs[3] = random.randint(0, (1<<64)-1)
+        initial_regs[1] = 0xdeadbeef
+        initial_regs[3] = 0x12345678
         with Program(lst) as program:
             sim = self.run_tst_program(program, initial_regs)
 
-    @unittest.skip("broken")
     def test_rlwnm(self):
         lst = ["rlwnm 3, 1, 2, 20, 6"]
         initial_regs = [0] * 32
index 5834df4077731e352fd956de4c0e48fcb821570f..29ebb5d6189bf1435eb21466b3cf8be8087e0d02 100644 (file)
@@ -194,7 +194,7 @@ class DecoderTestCase(FHDLTestCase):
         initial_regs[2] = 5
         with Program(lst) as program:
             sim = self.run_tst_program(program, initial_regs)
-            self.assertEqual(sim.gpr(1), SelectableInt(0x5fd757c0, 32))
+            self.assertEqual(sim.gpr(1), SelectableInt(0x5fd757c0, 64))
 
     def test_srw(self):
         lst = ["srw 1, 3, 2"]
@@ -203,7 +203,7 @@ class DecoderTestCase(FHDLTestCase):
         initial_regs[2] = 5
         with Program(lst) as program:
             sim = self.run_tst_program(program, initial_regs)
-            self.assertEqual(sim.gpr(1), SelectableInt(0x657f5d5, 32))
+            self.assertEqual(sim.gpr(1), SelectableInt(0x657f5d5, 64))
 
     def test_rlwinm(self):
         lst = ["rlwinm 3, 1, 5, 20, 6"]
@@ -213,6 +213,15 @@ class DecoderTestCase(FHDLTestCase):
             sim = self.run_tst_program(program, initial_regs)
             self.assertEqual(sim.gpr(3), SelectableInt(0xfe000fff, 64))
 
+    def test_rlwimi(self):
+        lst = ["rlwimi 3, 1, 5, 20, 6"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 0xdeadbeef
+        initial_regs[3] = 0x12345678
+        with Program(lst) as program:
+            sim = self.run_tst_program(program, initial_regs)
+            self.assertEqual(sim.gpr(3), SelectableInt(0xd4345dfb, 64))
+
     def test_mtcrf(self):
         for i in range(4):
             # 0x76540000 gives expected (3+4) (2+4) (1+4) (0+4) for