3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-03 09:50:24 +00:00

Mark kept FF output wires as ports directly instead of via the 'keep' attribute

This commit is contained in:
Robert O'Callahan 2025-07-26 09:34:37 +00:00
parent ebef91880d
commit d32c5b6d0e

View file

@ -291,12 +291,13 @@ void AbcModuleState::extract_cell(RTLIL::Module *module, RTLIL::Cell *cell, bool
return; return;
} }
if (keepff) int gate_id = map_signal(ff.sig_q, type, map_signal(ff.sig_d));
for (auto &c : ff.sig_q.chunks()) if (keepff) {
if (c.wire != nullptr) SigBit bit = ff.sig_q;
c.wire->attributes[ID::keep] = 1; if (assign_map(bit).wire != nullptr) {
signal_list[gate_id].is_port = true;
map_signal(ff.sig_q, type, map_signal(ff.sig_d)); }
}
ff.remove(); ff.remove();
return; return;
@ -942,7 +943,7 @@ void AbcModuleState::abc_module(RTLIL::Design *design, RTLIL::Module *module, co
log("Replacing %d occurrences of constant undef bits with constant zero bits\n", undef_bits_lost); log("Replacing %d occurrences of constant undef bits with constant zero bits\n", undef_bits_lost);
for (auto wire : module->wires()) { for (auto wire : module->wires()) {
if (wire->port_id > 0 || wire->get_bool_attribute(ID::keep)) if (wire->port_id > 0)
mark_port(wire); mark_port(wire);
} }