diff --git a/include/mockturtle/algorithms/node_resynthesis/cached.hpp b/include/mockturtle/algorithms/node_resynthesis/cached.hpp index 8dc7e0f08..bd5c1d8a7 100644 --- a/include/mockturtle/algorithms/node_resynthesis/cached.hpp +++ b/include/mockturtle/algorithms/node_resynthesis/cached.hpp @@ -180,7 +180,7 @@ class cached_resynthesis else { bool found_one = false; - auto on_signal = [&]( signal const& f ) { + auto on_signal = [&]( signal const& f ) -> bool { if ( !found_one ) { ++_cache_misses; @@ -192,6 +192,7 @@ class cached_resynthesis std::copy( _existing_signals.begin(), _existing_signals.end(), signals.begin() + _initial_size ); fn( cleanup_dangling( _cache.get_view( key ), ntk, signals.begin(), signals.end() ).front() ); } + return false; }; _resyn_fn( _cache.network(), function, _cache.pis().begin(), _cache.pis().begin() + function.num_vars(), on_signal ); @@ -307,4 +308,4 @@ class cached_resynthesis uint32_t _cache_hits{}; uint32_t _cache_misses{}; }; -} /* namespace mockturtle */ \ No newline at end of file +} /* namespace mockturtle */ diff --git a/include/mockturtle/algorithms/node_resynthesis/exact.hpp b/include/mockturtle/algorithms/node_resynthesis/exact.hpp index 952630a50..b28be89ea 100644 --- a/include/mockturtle/algorithms/node_resynthesis/exact.hpp +++ b/include/mockturtle/algorithms/node_resynthesis/exact.hpp @@ -399,6 +399,8 @@ struct exact_xmg_resynthesis_params { uint32_t num_candidates{10u}; bool use_only_self_dual_gates{false}; + bool use_xor3{true}; + int conflict_limit{0}; }; /*! \brief Resynthesis function based on exact synthesis for XMGs. @@ -448,6 +450,7 @@ class exact_xmg_resynthesis percy::spec spec; spec.verbosity = 0; spec.fanin = 3; + spec.conflict_limit = ps.conflict_limit; /* specify local normalized gate primitives */ kitty::dynamic_truth_table const0{3}; @@ -471,7 +474,10 @@ class exact_xmg_resynthesis spec.add_primitive( a ^ b ); // 66 spec.add_primitive( a ^ c ); // 3c spec.add_primitive( b ^ c ); // 5a - spec.add_primitive( a ^ b ^ c ); // 96 + if ( ps.use_xor3 ) + { + spec.add_primitive( a ^ b ^ c ); // 96 + } /* add non-self dual gate functions */ if ( !ps.use_only_self_dual_gates ) @@ -601,4 +607,4 @@ class exact_xmg_resynthesis exact_xmg_resynthesis_params const& ps; }; /* exact_xmg_resynthesis */ -} /* namespace mockturtle */ \ No newline at end of file +} /* namespace mockturtle */