udata <std::function<SigSpec(const SigSpec&)>> unextend
state <SigSpec> 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--)
++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