add extswsli unit test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 13 Jul 2020 10:27:08 +0000 (11:27 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 13 Jul 2020 10:27:08 +0000 (11:27 +0100)
src/soc/fu/shift_rot/test/test_pipe_caller.py

index 263de991d605a81a09223ce26a494ec7ad900159..c1b20b1a9de8e1407ba7a9f9b0d10b98abc18dc5 100644 (file)
@@ -141,6 +141,14 @@ class ShiftRotTestCase(FHDLTestCase):
         initial_regs[1] = random.randint(0, (1<<64)-1)
         self.run_tst_program(Program(lst, bigendian), initial_regs)
 
+    def test_extswsli(self):
+        for i in range(40):
+            sh = random.randint(0, 63)
+            lst = [f"extswsli 3, 1, {sh}"]
+            initial_regs = [0] * 32
+            initial_regs[1] = random.randint(0, (1<<64)-1)
+            self.run_tst_program(Program(lst, bigendian), initial_regs)
+
     def test_rlc(self):
         insns = ["rldic", "rldicl", "rldicr"]
         for i in range(20):