Merge branch 'master' of git.libre-soc.org:soc
authorCole Poirier <colepoirier@gmail.com>
Thu, 6 Aug 2020 17:49:56 +0000 (10:49 -0700)
committerCole Poirier <colepoirier@gmail.com>
Thu, 6 Aug 2020 17:49:56 +0000 (10:49 -0700)
src/soc/fu/mul/test/test_pipe_caller.py

index f7e3c8681aea849a5ac80b8a7776203b121f8353..42d9e334bcc86c8ec1c4eb012260e1949ecb9e52 100644 (file)
@@ -271,18 +271,19 @@ class MulTestCase(TestAccumulatorBase):
             0xfffffffd
         ]
 
-        x = 0x7fffffff + random.randint(0, 1)
-        ra = random.randint(0, (1 << 64)-1)
-        rb = x // ra
-
         for instr in instrs:
-            l = [f"{instr} 3, 1, 2"]
-            initial_regs = [0] * 32
-            initial_regs[1] = ra
-            initial_regs[2] = rb
-            # use "with" so as to close the files used
-            with Program(l, bigendian) as prog:
-                self.add_case(prog, initial_regs)
+            for i in range(20):
+                x = 0x7fffffff + random.randint(0, 1)
+                ra = random.randint(0, (1 << 32)-1)
+                rb = x // ra
+
+                l = [f"{instr} 3, 1, 2"]
+                initial_regs = [0] * 32
+                initial_regs[1] = ra
+                initial_regs[2] = rb
+                # use "with" so as to close the files used
+                with Program(l, bigendian) as prog:
+                    self.add_case(prog, initial_regs)
 
     def case_mulli(self):