Balancing¶
Header: mockturtle/algorithms/balancing.hpp
Parameters and Statistics¶
Algorithm¶
-
template<class Ntk, class CostFn = unit_cost<Ntk>>
Ntk mockturtle::balancing(Ntk const &ntk, rebalancing_function_t<Ntk> const &rebalancing_fn = {}, balancing_params const &ps = {}, balancing_stats *pst = nullptr)¶ Balancing of a logic network
This function implements a dynamic-programming and cut-enumeration based balancing algorithm. It returns a new network of the same type and performs generic balancing by providing a rebalancing function.
The template parameter
CostFnis only used to compute the critical paths, when theonly_on_critical_pathparameter is assigned true. Note that the size for rewriting candidates is computed by the rebalancing function and may not correspond to the cost given by CostFn.Example
const auto aig = ...; sop_rebalancing<aig_network> balance_fn; balancing_params ps; ps.cut_enumeration_ps.cut_size = 6u; const auto balanced_aig = balancing( aig, {balance_fn}, ps );
Rebalancing engines¶
Header: mockturtle/algorithms/balancing/sop_balancing.hpp
-
template<class Ntk>
struct sop_rebalancing¶ SOP rebalancing function.
This class can be used together with the generic
balancingfunction. It converts each cut function into an SOP and then performs weight-oriented tree balancing on the AND terms and the outer OR function.