add OP_CMPB formal proof
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 24 May 2020 19:23:54 +0000 (20:23 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 24 May 2020 19:23:59 +0000 (20:23 +0100)
src/soc/fu/logical/formal/proof_main_stage.py

index 43dab03f0eb6bcc996450b0db641e29b6dd1a927..9e6d17a2fa4ad7ec001c034ba3e6ef4e6420b5a2 100644 (file)
@@ -143,8 +143,12 @@ class Driver(Elaboratable):
                         comb += Assert(o == peo64)
 
             with m.Case(InternalOp.OP_CMPB):
-                # TODO
-                pass
+                for i in range(8):
+                    slc = slice(i*8, (i+1)*8)
+                    with m.If(a[slc] == b[slc]):
+                        comb += Assert(o[slc] == 0xff)
+                    with m.Else():
+                        comb += Assert(o[slc] == 0)
 
             with m.Case(InternalOp.OP_BPERM):
                 # note that this is a copy of the beautifully-documented