pm.autoremove(st.ffH);
pm.autoremove(st.addAB);
if (st.ffO_lo) {
- SigSpec O = st.sigO.extract(0,16);
+ SigSpec O = st.sigO.extract(0,GetSize(st.ffO_lo));
st.ffO_lo->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O)));
}
if (st.ffO_hi) {
- SigSpec O = st.sigO.extract(16,16);
+ SigSpec O = st.sigO.extract(16,GetSize(st.ffo_hi));
st.ffO_hi->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O)));
}
}
match ffO_lo
select ffO_lo->type.in($dff)
- filter nusers(sigO.extract(0,16)) == 2
- filter includes(port(ffO_lo, \D).to_sigbit_set(), sigO.extract(0,16).to_sigbit_set())
+ filter GetSize(sigO) >= param(ffO_lo, \WIDTH).as_int()
+ filter nusers(sigO.extract(0,param(ffO_lo, \WIDTH).as_int())) == 2
+ filter includes(port(ffO_lo, \D).to_sigbit_set(), sigO.extract(0,param(ffO_lo, \WIDTH).as_int()).to_sigbit_set())
optional
endmatch
match ffO_hi
select ffO_hi->type.in($dff)
- filter nusers(sigO.extract(16,16)) == 2
- filter includes(port(ffO_hi, \D).to_sigbit_set(), sigO.extract(16,16).to_sigbit_set())
+ filter GetSize(sigO) >= 16+param(ffO_hi, \WIDTH).as_int()
+ filter nusers(sigO.extract(16,param(ffO_hi, \WIDTH).as_int())) == 2
+ filter includes(port(ffO_hi, \D).to_sigbit_set(), sigO.extract(16,param(ffO_hi, \WIDTH).as_int()).to_sigbit_set())
optional
endmatch
clock = c;
clock_pol = cp;
- if (port(ffO_lo, \Q) != sigO.extract(0,16))
+ if (port(ffO_lo, \Q) != sigO.extract(0,param(ffO_lo, \WIDTH).as_int()))
sigO.replace(port(ffO_lo, \D), port(ffO_lo, \Q));
}
clock = c;
clock_pol = cp;
- if (port(ffO_hi, \Q) != sigO.extract(16,16))
+ if (port(ffO_hi, \Q) != sigO.extract(16,param(ffO_hi, \WIDTH).as_int()))
sigO.replace(port(ffO_hi, \D), port(ffO_hi, \Q));
}