diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-03-11 06:32:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 06:32:15 -0700 |
commit | dd8ebf7873eadab9c6d0fba8c4ed25eb88acbb8f (patch) | |
tree | 09385b6820806a6be79510f7d90c047027d4df6e /backends | |
parent | d624a11dd19321cba03c1b5c474a9827171657d6 (diff) | |
parent | 3be7784d0e06f75d5e35eb356b726b559f647f13 (diff) | |
download | yosys-dd8ebf7873eadab9c6d0fba8c4ed25eb88acbb8f.tar.gz yosys-dd8ebf7873eadab9c6d0fba8c4ed25eb88acbb8f.tar.bz2 yosys-dd8ebf7873eadab9c6d0fba8c4ed25eb88acbb8f.zip |
Merge pull request #1743 from YosysHQ/eddie/abc9_keep
abc9: improve (* keep *) handling
Diffstat (limited to 'backends')
-rw-r--r-- | backends/aiger/xaiger.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc index 402f41597..cde6d066a 100644 --- a/backends/aiger/xaiger.cc +++ b/backends/aiger/xaiger.cc @@ -174,11 +174,12 @@ struct XAigerWriter undriven_bits.insert(bit); unused_bits.insert(bit); - bool keep = wire->get_bool_attribute(ID::keep); - if (wire->port_input || keep) + bool scc = wire->attributes.count(ID(abc9_scc)); + if (wire->port_input || scc) input_bits.insert(bit); - if (wire->port_output || keep) { + bool keep = wire->get_bool_attribute(ID::keep); + if (wire->port_output || keep || scc) { if (bit != wirebit) alias_map[wirebit] = bit; output_bits.insert(wirebit); @@ -223,8 +224,6 @@ struct XAigerWriter alias_map[Q] = D; auto r YS_ATTRIBUTE(unused) = ff_bits.insert(std::make_pair(D, cell)); log_assert(r.second); - if (input_bits.erase(Q)) - log_assert(Q.wire->attributes.count(ID::keep)); continue; } @@ -378,11 +377,6 @@ struct XAigerWriter alias_map[O] = b; ci_bits.emplace_back(b); undriven_bits.erase(O); - // If PI and CI, then must be a (* keep *) wire - if (input_bits.erase(O)) { - log_assert(output_bits.count(O)); - log_assert(O.wire->get_bool_attribute(ID::keep)); - } } } @@ -467,8 +461,8 @@ struct XAigerWriter for (const auto &bit : output_bits) { ordered_outputs[bit] = aig_o++; int aig; - // Unlike bit2aig() which checks aig_map first, for - // inout/keep bits, since aig_map will point to + // Unlike bit2aig() which checks aig_map first for + // inout/scc bits, since aig_map will point to // the PI, first attempt to find the NOT/AND driver // before resorting to an aig_map lookup (which // could be another PO) |