bit-test on the function-unit value being tested
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 31 May 2020 23:20:20 +0000 (00:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 31 May 2020 23:20:20 +0000 (00:20 +0100)
this because Function Unit is a bitfield

src/soc/fu/compunits/test/test_compunit.py

index 62d2f2aaa9e4329c4ae1a75857038e5f4525c72e..9970c2db24900d66f618ffedb25ee1872d5470a6 100644 (file)
@@ -150,7 +150,8 @@ class TestRunner(FHDLTestCase):
                     yield instruction.eq(ins)          # raw binary instr.
                     yield Settle()
                     fn_unit = yield pdecode2.e.fn_unit
-                    self.assertEqual(fn_unit, self.funit.value)
+                    fuval = self.funit.value
+                    self.assertEqual(fn_unit & fuval, fuval)
 
                     # set operand and get inputs
                     yield from set_operand(cu, pdecode2, sim)