MUL pipeline: account for overflow flags. WIP
authorSamuel A. Falvo II <kc5tja@arrl.net>
Fri, 21 Aug 2020 02:54:20 +0000 (19:54 -0700)
committerSamuel A. Falvo II <kc5tja@arrl.net>
Fri, 21 Aug 2020 02:54:38 +0000 (19:54 -0700)
src/soc/fu/mul/formal/proof_main_stage.py

index e9f505932bc808c52fa92322742563592b2951e1..7ca876d4338579e080b3b4b50f1733280bf5f048 100644 (file)
@@ -124,16 +124,19 @@ class Driver(Elaboratable):
 
             # mulli, mullw(o)
             with m.Case(MicrOp.OP_MUL_L64):
-                with m.If(rec.is_32bit):
-                    expected_product = Signal(64)
-#                   expected_o = Signal.like(expected_product)
+                expected_product = Signal(64)
+                expected_ov = Signal()
 
+                with m.If(rec.is_32bit):
                     # unsigned lo64 - mulwu
                     with m.If(~rec.is_signed):
                         comb += expected_product.eq(a[0:32] * b[0:32])
-#                       comb += expected_o.eq(Repl(expected_product[0:32], 2))
                         comb += Assert(dut.o.o.data[0:64] == expected_product[0:64])
 
+                        m31 = expected_product[31:64]
+                        comb += expected_ov.eq(m31.bool() & ~m31.all())
+                        comb += Assert(dut.o.xer_ov.data == Repl(expected_ov, 2))
+
                     # signed lo64 - mulw
                     with m.Else():
                         pass