From d0dbbc26054d1cd7b8766e2d996196e246216e8c Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 23 Sep 2019 13:26:34 -0700 Subject: Move unextend initialisation later --- passes/pmgen/xilinx_dsp_cascade.pmg | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'passes') diff --git a/passes/pmgen/xilinx_dsp_cascade.pmg b/passes/pmgen/xilinx_dsp_cascade.pmg index 19fe48bba..37674efea 100644 --- a/passes/pmgen/xilinx_dsp_cascade.pmg +++ b/passes/pmgen/xilinx_dsp_cascade.pmg @@ -3,7 +3,15 @@ pattern xilinx_dsp_cascadeP udata > unextend state sigC -code +match dsp_pcin + select dsp_pcin->type.in(\DSP48E1) + select !param(dsp_pcin, \CREG, State::S1).as_bool() + select port(dsp_pcin, \OPMODE, Const(0, 7)).extract(4,3) == Const::from_string("011") + select nusers(port(dsp_pcin, \C, SigSpec())) > 1 + select nusers(port(dsp_pcin, \PCIN, SigSpec())) == 0 +endmatch + +code sigC unextend = [](const SigSpec &sig) { int i; for (i = GetSize(sig)-1; i > 0; i--) @@ -14,17 +22,6 @@ code ++i; return sig.extract(0, i); }; -endcode - -match dsp_pcin - select dsp_pcin->type.in(\DSP48E1) - select !param(dsp_pcin, \CREG, State::S1).as_bool() - select port(dsp_pcin, \OPMODE, Const(0, 7)).extract(4,3) == Const::from_string("011") - select nusers(port(dsp_pcin, \C, SigSpec())) > 1 - select nusers(port(dsp_pcin, \PCIN, SigSpec())) == 0 -endmatch - -code sigC sigC = unextend(port(dsp_pcin, \C)); endcode -- cgit v1.2.3