diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index 0c2576c1a..dfaee9415 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -291,12 +291,15 @@ void AbcModuleState::extract_cell(RTLIL::Module *module, RTLIL::Cell *cell, bool return; } - if (keepff) - for (auto &c : ff.sig_q.chunks()) - if (c.wire != nullptr) - c.wire->attributes[ID::keep] = 1; - - map_signal(ff.sig_q, type, map_signal(ff.sig_d)); + int gate_id = map_signal(ff.sig_q, type, map_signal(ff.sig_d)); + if (keepff) { + SigBit bit = ff.sig_q; + if (assign_map(bit).wire != nullptr) { + signal_list[gate_id].is_port = true; + } + if (bit.wire != nullptr) + bit.wire->attributes[ID::keep] = 1; + } ff.remove(); return;