From: Clifford Wolf Date: Tue, 15 May 2018 12:02:27 +0000 (+0200) Subject: Fix iopadmap for loops between tristate IO buffers X-Git-Tag: yosys-0.8~94 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe80b39f56fb650cc67bed09f29ea42e0e5f6e52;p=yosys.git Fix iopadmap for loops between tristate IO buffers Signed-off-by: Clifford Wolf --- diff --git a/passes/techmap/iopadmap.cc b/passes/techmap/iopadmap.cc index c20081c64..690ba87ed 100644 --- a/passes/techmap/iopadmap.cc +++ b/passes/techmap/iopadmap.cc @@ -175,6 +175,8 @@ struct IopadmapPass : public Pass { if (!toutpad_celltype.empty() || !tinoutpad_celltype.empty()) { dict>> tbuf_bits; + pool> norewrites; + SigMap rewrites; for (auto cell : module->cells()) if (cell->type == "$_TBUF_") { @@ -246,6 +248,9 @@ struct IopadmapPass : public Pass { module->remove(tbuf_cell); skip_wires[wire->name].insert(i); + + norewrites.insert(make_pair(cell->name, RTLIL::escape_id(tinoutpad_portname4))); + rewrites.add(sigmap(wire_bit), owire); continue; } @@ -283,6 +288,22 @@ struct IopadmapPass : public Pass { } } } + + if (GetSize(norewrites)) + { + for (auto cell : module->cells()) + for (auto port : cell->connections()) + { + if (norewrites.count(make_pair(cell->name, port.first))) + continue; + + SigSpec orig_sig = sigmap(port.second); + SigSpec new_sig = rewrites(orig_sig); + + if (orig_sig != new_sig) + cell->setPort(port.first, new_sig); + } + } } for (auto wire : module->selected_wires())