Only trim sigM if USE_MULT; only look for ffM then too
authorEddie Hung <eddie@fpgeh.com>
Tue, 10 Sep 2019 03:57:03 +0000 (20:57 -0700)
committerEddie Hung <eddie@fpgeh.com>
Tue, 10 Sep 2019 03:57:03 +0000 (20:57 -0700)
passes/pmgen/xilinx_dsp.pmg

index 3185c46417a0a71aa7aa195088c7ba42eeedaa0b..07432dfc7591668244a9641a36dbfb55abbca4cf 100644 (file)
@@ -39,16 +39,18 @@ code unextend sigA sigB sigC sigD sigM
        sigD = dsp->connections_.at(\D, SigSpec());
 
        SigSpec P = port(dsp, \P);
-       // Only care about those bits that are used
-       int i;
-       for (i = 0; i < GetSize(P); i++) {
-               if (nusers(P[i]) <= 1)
-                       break;
-               sigM.append(P[i]);
+       if (dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY") {
+               // Only care about those bits that are used
+               int i;
+               for (i = 0; i < GetSize(P); i++) {
+                       if (nusers(P[i]) <= 1)
+                               break;
+                       sigM.append(P[i]);
+               }
+               log_assert(nusers(P.extract_end(i)) <= 1);
        }
-       log_assert(nusers(P.extract_end(i)) <= 1);
-       //if (GetSize(sigM) <= 10)
-       //      reject;
+       else
+               sigM = P;
 endcode
 
 code argQ ffAD ffADmux ffADenpol sigA clock
@@ -159,6 +161,7 @@ endcode
 
 match ffMmux
        if param(dsp, \MREG).as_int() == 0
+       if dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY"
        if nusers(sigM) == 2
        select ffMmux->type.in($mux)
        choice <IdString> BA {\B, \A}
@@ -194,6 +197,7 @@ match ffM_enable
 endmatch
 
 match ffM
+       if dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY"
        if !ffM_enable
        if param(dsp, \MREG).as_int() == 0
        if nusers(sigM) == 2