3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-17 04:35:44 +00:00

patch: merge src into existing cells; opt_merge/_inc + onehot + ff.cc use Patch

This commit is contained in:
Emil J. Tywoniak 2026-05-30 19:07:37 +02:00
parent ea41e61a36
commit e583da906d
6 changed files with 122 additions and 52 deletions

View file

@ -35,6 +35,13 @@ public:
void patch(Cell* old_cell, IdString old_port, SigSpec new_sig);
void patch(Cell* old_cell, const std::vector<std::pair<IdString, SigSpec>> &port_replacements);
// Variants for "merge old_cell into an existing keep_cell" (e.g.
// opt_merge): the old_cell's src attribute is collected and combined
// with merge_src_into's existing src, and the result is set on
// merge_src_into. Any new cells in cells_ also receive the combined src.
void patch(Cell* old_cell, IdString old_port, SigSpec new_sig, Cell* merge_src_into);
void patch(Cell* old_cell, const std::vector<std::pair<IdString, SigSpec>> &port_replacements, Cell* merge_src_into);
RTLIL::Wire *addWire(RTLIL::IdString name, int width = 1);
RTLIL::Wire *addWire(RTLIL::IdString name, const RTLIL::Wire *other);