3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-11 19:35:59 +00:00

fixup! async2sync: $dffsr has undef output on S&R

This commit is contained in:
Emil J. Tywoniak 2026-03-09 20:12:24 +01:00
parent 85013f9ed3
commit 43ef4d2901

View file

@ -160,26 +160,26 @@ struct Async2syncPass : public Pass {
SigSpec sig_clr_inv = ff.sig_clr; SigSpec sig_clr_inv = ff.sig_clr;
if (!ff.pol_set) { if (!ff.pol_set) {
if (!ff.is_fine || sig_set.size() > 1) if (!ff.is_fine)
sig_set = module->Not(NEW_ID, sig_set); sig_set = module->Not(NEW_ID, sig_set);
else else
sig_set = module->NotGate(NEW_ID, sig_set); sig_set = module->NotGate(NEW_ID, sig_set);
} }
if (ff.pol_clr) { if (ff.pol_clr) {
if (!ff.is_fine || sig_clr.size() > 1) if (!ff.is_fine)
sig_clr_inv = module->Not(NEW_ID, sig_clr); sig_clr_inv = module->Not(NEW_ID, sig_clr);
else else
sig_clr_inv = module->NotGate(NEW_ID, sig_clr); sig_clr_inv = module->NotGate(NEW_ID, sig_clr);
} else { } else {
if (!ff.is_fine || sig_clr.size() > 1) if (!ff.is_fine)
sig_clr = module->Not(NEW_ID, sig_clr); sig_clr = module->Not(NEW_ID, sig_clr);
else else
sig_clr = module->NotGate(NEW_ID, sig_clr); sig_clr = module->NotGate(NEW_ID, sig_clr);
} }
SigSpec set_and_clr; SigSpec set_and_clr;
if (!ff.is_fine || sig_clr.size() > 1 || sig_set.size() > 1) if (!ff.is_fine)
set_and_clr = module->And(NEW_ID, sig_set, sig_clr); set_and_clr = module->And(NEW_ID, sig_set, sig_clr);
else else
set_and_clr = module->AndGate(NEW_ID, sig_set, sig_clr); set_and_clr = module->AndGate(NEW_ID, sig_set, sig_clr);