diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-29 17:24:03 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-29 17:24:03 -0700 |
commit | 18cabe9370c46b72e9fb52eb9be5a7c7fb873274 (patch) | |
tree | 449d96fc3597dc26e2c9f0e198662a32c9f5d650 /passes/techmap | |
parent | c52db44f9ab19194dbdefd35bd697ab99650f510 (diff) | |
download | yosys-18cabe9370c46b72e9fb52eb9be5a7c7fb873274.tar.gz yosys-18cabe9370c46b72e9fb52eb9be5a7c7fb873274.tar.bz2 yosys-18cabe9370c46b72e9fb52eb9be5a7c7fb873274.zip |
Output has priority over input when stitching in abc9
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/abc9.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc index f2662e0cb..6fdf987f0 100644 --- a/passes/techmap/abc9.cc +++ b/passes/techmap/abc9.cc @@ -694,30 +694,27 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *current_module, std::stri int in_wires = 0, out_wires = 0; // Stitch in mapped_mod's inputs/outputs into module - for (auto &it : mapped_mod->wires_) { - RTLIL::Wire *w = it.second; - if (!w->port_input && !w->port_output) - continue; - RTLIL::Wire *wire = module->wire(w->name); + for (auto port : mapped_mod->ports) { + RTLIL::Wire *w = mapped_mod->wire(port); + RTLIL::Wire *wire = module->wire(port); log_assert(wire); - RTLIL::Wire *remap_wire = module->wire(remap_name(w->name)); + RTLIL::Wire *remap_wire = module->wire(remap_name(port)); RTLIL::SigSpec signal = RTLIL::SigSpec(wire, 0, GetSize(remap_wire)); log_assert(GetSize(signal) >= GetSize(remap_wire)); - log_assert(w->port_input || w->port_output); RTLIL::SigSig conn; - if (w->port_input) { - conn.first = remap_wire; - conn.second = signal; - in_wires++; - module->connect(conn); - } if (w->port_output) { conn.first = signal; conn.second = remap_wire; out_wires++; module->connect(conn); } + else if (w->port_input) { + conn.first = remap_wire; + conn.second = signal; + in_wires++; + module->connect(conn); + } } for (auto &it : bit_users) |