mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 11:26:22 +00:00
patch: source transfer
This commit is contained in:
parent
db1c1d4359
commit
9f22b9d2a0
5 changed files with 68 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue