update to new names for XER fields
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 20 May 2020 16:50:32 +0000 (17:50 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 20 May 2020 16:50:32 +0000 (17:50 +0100)
src/soc/fu/alu/formal/proof_main_stage.py

index 3bc06e6f9f3aefd57a502ce76e844061efcf4927..91aaac5bfb21cb7d93022164b615936f81a7fa1f 100644 (file)
@@ -39,16 +39,17 @@ class Driver(Elaboratable):
         # convenience variables
         a = dut.i.a
         b = dut.i.b
-        carry_in = dut.i.carry_in
-        so_in = dut.i.so
-        carry_out = dut.o.xer_co.data[0]
-        carry_out32 = dut.o.xer_co.data[1]
+        carry_in = dut.i.xer_ca[0]
+        carry_in32 = dut.i.xer_ca[1]
+        so_in = dut.i.xer_so
+        carry_out = dut.o.xer_ca.data[0]
+        carry_out32 = dut.o.xer_ca.data[1]
         o = dut.o.o
 
         # setup random inputs
         comb += [a.eq(AnyConst(64)),
                  b.eq(AnyConst(64)),
-                 carry_in.eq(AnyConst(1)),
+                 carry_in.eq(AnyConst(0b11)),
                  so_in.eq(AnyConst(1))]
 
         comb += dut.i.ctx.op.eq(rec)
@@ -73,8 +74,8 @@ class Driver(Elaboratable):
 
                 comb += Assert(Cat(o, carry_out) == (a + b + carry_in))
 
-                # CA32
-                comb += Assert((a[0:32] + b[0:32] + carry_in)[32]
+                # CA32 - XXX note this fails! replace with carry_in and it works
+                comb += Assert((a[0:32] + b[0:32] + carry_in32)[32]
                                == carry_out32)
             with m.Case(InternalOp.OP_EXTS):
                 for i in [1, 2, 4]: