Add test for random rlcd(l/r) instructions
authorMichael Nolan <mtnolan2640@gmail.com>
Wed, 13 May 2020 22:47:44 +0000 (18:47 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Wed, 13 May 2020 22:49:58 +0000 (18:49 -0400)
src/soc/shift_rot/test/test_pipe_caller.py

index 6eae89a6d60962156c3f03d90193b50ff90f59e5..e1ca7fc5e122585a87dc806a0d2b85ca821abb50 100644 (file)
@@ -166,6 +166,17 @@ class ALUTestCase(FHDLTestCase):
         initial_regs[1] = random.randint(0, (1<<64)-1)
         self.run_tst_program(Program(lst), initial_regs)
 
+    def test_rlc(self):
+        insns = ["rldic", "rldicl", "rldicr"]
+        for i in range(20):
+            choice = random.choice(insns)
+            sh = random.randint(0, 63)
+            m = random.randint(0, 63)
+            lst = [f"{choice} 3, 1, {sh}, {m}"]
+            initial_regs = [0] * 32
+            initial_regs[1] = random.randint(0, (1<<64)-1)
+            self.run_tst_program(Program(lst), initial_regs)
+
     def test_ilang(self):
         rec = CompALUOpSubset()