3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-25 11:26:22 +00:00

patch: source transfer

This commit is contained in:
Emil J. Tywoniak 2026-05-19 19:31:16 +02:00
parent db1c1d4359
commit 9f22b9d2a0
5 changed files with 68 additions and 6 deletions

View file

@ -24,13 +24,14 @@ struct TestPatchPass : public Pass {
log_assert(neg->type == ID($not));
RTLIL::Patch patcher;
patcher.mod = module;
patcher.map = SigMap(module);
auto sub = patcher.addSub(NEW_ID,
neg->getPort(ID::A),
cell->getPort(ID::A),
add->getPort(ID::A),
patcher.addWire(NEW_ID, cell->getPort(ID::A).size()));
auto new_cell = patcher.addNeg(NEW_ID, sub->getPort(ID::Y), SigSpec());
log_cell(new_cell);
patcher.leaves.insert(neg->getPort(ID::A).as_wire());
patcher.leaves.insert(add->getPort(ID::A).as_wire());
patcher.patch(add, new_cell);
}
}