diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-06-20 19:27:00 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-06-20 19:41:27 -0700 |
commit | 9faeba7a66c34d57bcae6ad83580e640ee5907e6 (patch) | |
tree | be2e50abcee1b151c7de937d3153e06acd0b9305 /backends/aiger | |
parent | eb09ea6d54738b82924e33c26f47fe35fbdd24cd (diff) | |
download | yosys-9faeba7a66c34d57bcae6ad83580e640ee5907e6.tar.gz yosys-9faeba7a66c34d57bcae6ad83580e640ee5907e6.tar.bz2 yosys-9faeba7a66c34d57bcae6ad83580e640ee5907e6.zip |
Fix broken abc9.v test due to inout being 1'bx
Diffstat (limited to 'backends/aiger')
-rw-r--r-- | backends/aiger/xaiger.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc index 42f54209b..f0a9ccdb9 100644 --- a/backends/aiger/xaiger.cc +++ b/backends/aiger/xaiger.cc @@ -75,6 +75,7 @@ struct XAigerWriter dict<SigBit, int> ordered_outputs; vector<Cell*> box_list; + bool omode = false; int mkgate(int a0, int a1) { @@ -409,9 +410,9 @@ struct XAigerWriter // If encountering an inout port, or a keep-ed wire, then create a new wire // with $inout.out suffix, make it a PO driven by the existing inout, and // inherit existing inout's drivers - if ((wire->port_input && wire->port_output && !undriven_bits.count(bit)) + if ((wire->port_input && wire->port_output && output_bits.count(bit) && !undriven_bits.count(bit)) || wire->attributes.count("\\keep")) { - log_assert(input_bits.count(bit) && output_bits.count(bit)); + log_assert(output_bits.count(bit)); RTLIL::IdString wire_name = wire->name.str() + "$inout.out"; RTLIL::Wire *new_wire = module->wire(wire_name); if (!new_wire) @@ -486,6 +487,12 @@ struct XAigerWriter ordered_outputs[bit] = aig_o++; aig_outputs.push_back(bit2aig(bit)); } + + if (output_bits.empty()) { + aig_o++; + aig_outputs.push_back(0); + omode = true; + } } void write_aiger(std::ostream &f, bool ascii_mode) @@ -741,6 +748,8 @@ struct XAigerWriter for (auto &it : output_lines) f << it.second; log_assert(output_lines.size() == output_bits.size()); + if (omode && output_bits.empty()) + f << "output " << output_lines.size() << " 0 $__dummy__\n"; wire_lines.sort(); for (auto &it : wire_lines) |