add andc and orc tests, failing because RB needs inversion not RA
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Aug 2020 14:11:25 +0000 (15:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Aug 2020 14:39:43 +0000 (15:39 +0100)
src/soc/fu/logical/test/test_pipe_caller.py

index 725cf306b11534c6dc2cc5d9a8daecc4ecedfc20..9172cb09bf9ad3e9f2b9caa1a316dfb6e4733f6a 100644 (file)
@@ -61,6 +61,16 @@ def set_alu_inputs(alu, dec2, sim):
 
 class LogicalTestCase(TestAccumulatorBase):
 
+    def case_complement(self):
+        insns = ["andc", "orc"]
+        for i in range(40):
+            choice = random.choice(insns)
+            lst = [f"{choice} 3, 1, 2"]
+            initial_regs = [0] * 32
+            initial_regs[1] = random.randint(0, (1 << 64)-1)
+            initial_regs[2] = random.randint(0, (1 << 64)-1)
+            self.add_case(Program(lst, bigendian), initial_regs)
+
     def case_rand(self):
         insns = ["and", "or", "xor"]
         for i in range(40):