cell->setPort("\\CLK", st.clock);
if (st.ffA) {
+ SigSpec A = cell->getPort("\\A");
SigSpec D = st.ffA->getPort("\\D");
- cell->setPort("\\A", D.extend_u0(30, true));
+ SigSpec Q = st.ffA->getPort("\\Q");
+ A.replace(Q, D);
+ cell->setPort("\\A", A);
cell->setParam("\\AREG", State::S1);
if (st.ffA->type == "$dff")
cell->setPort("\\CEA2", State::S1);
else log_abort();
}
if (st.ffB) {
+ SigSpec B = cell->getPort("\\B");
SigSpec D = st.ffB->getPort("\\D");
- cell->setPort("\\B", D.extend_u0(18, true));
+ SigSpec Q = st.ffB->getPort("\\Q");
+ B.replace(Q, D);
+ cell->setPort("\\B", B);
cell->setParam("\\BREG", State::S1);
if (st.ffB->type == "$dff")
cell->setPort("\\CEB2", State::S1);
if (st.ffP) {
SigSpec P = cell->getPort("\\P");
SigSpec Q = st.ffP->getPort("\\Q");
- Q.append(P.extract(GetSize(Q), -1));
+ P.replace(Q, P.extract(0, GetSize(Q)));
cell->setPort("\\P", Q);
cell->setParam("\\PREG", State::S1);
if (st.ffP->type == "$dff")
select ffA->type.in($dff, $dffe)
select param(ffA, \CLK_POLARITY).as_bool()
// select nusers(port(ffA, \Q)) == 2
- index <SigSpec> port(ffA, \Q).extend_u0(25, true) === port(dsp, \A).extract(0, 25)
+ index <SigSpec> port(ffA, \Q).to_sigbit_pool() === port(dsp, \A).remove_const().to_sigbit_pool()
// DSP48E1 does not support clock inversion
optional
endmatch
select ffB->type.in($dff, $dffe)
select param(ffB, \CLK_POLARITY).as_bool()
// select nusers(port(ffB, \Q)) == 2
- index <SigSpec> port(ffB, \Q).extend_u0(18, true) === port(dsp, \B)
+ index <SigSpec> port(ffB, \Q).to_sigbit_pool() === port(dsp, \B).remove_const().to_sigbit_pool()
optional
endmatch