Do not die if DSP48E1.P has no users (would otherwise get 'clean'-ed)
authorEddie Hung <eddie@fpgeh.com>
Thu, 26 Sep 2019 05:58:03 +0000 (22:58 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 26 Sep 2019 05:58:03 +0000 (22:58 -0700)
passes/pmgen/xilinx_dsp.pmg

index 0a345e88d4bb408c2cd8807d5290b04631bdc976..3d0b1f2c3ce80f736b8ee1439a5057f8c1b37a6a 100644 (file)
@@ -53,6 +53,10 @@ code sigA sigB sigC sigD sigM clock
        }
        else
                sigM = P;
+       // This sigM could have no users if downstream $add
+       //   is narrower than $mul result, for example
+       if (sigM.empty())
+               reject;
 
        clock = port(dsp, \CLK, SigBit());
 endcode
@@ -261,7 +265,7 @@ endcode
 
 match postAdd
        // Ensure that Z mux is not already used
-       if port(dsp, \OPMODE).extract(4,3).is_fully_zero()
+       if port(dsp, \OPMODE, SigSpec()).extract(4,3).is_fully_zero()
 
        select postAdd->type.in($add)
        select GetSize(port(postAdd, \Y)) <= 48