From 2c044304453ed0f2533af30cfbb347bf0fe6354d Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 9 Sep 2019 20:57:03 -0700 Subject: [PATCH] Only trim sigM if USE_MULT; only look for ffM then too --- passes/pmgen/xilinx_dsp.pmg | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/passes/pmgen/xilinx_dsp.pmg b/passes/pmgen/xilinx_dsp.pmg index 3185c4641..07432dfc7 100644 --- a/passes/pmgen/xilinx_dsp.pmg +++ b/passes/pmgen/xilinx_dsp.pmg @@ -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 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 -- 2.30.2