Balancing
Header: mockturtle/algorithms/balancing.hpp
Parameters and Statistics
Algorithm
-
template<class Ntk>
Ntk mockturtle::sop_balancing(Ntk const &ntk, lut_map_params const &ps = {}, lut_map_stats *pst = nullptr) SOP balancing of a logic network.
This function implements an LUT-based SOP balancing algorithm. It returns a new network of the same type and performs generic balancing by providing a rebalancing function.
-
template<class Ntk>
Ntk mockturtle::esop_balancing(Ntk const &ntk, lut_map_params const &ps = {}, lut_map_stats *pst = nullptr) ESOP balancing of a logic network.
This function implements an LUT-based ESOP balancing algorithm. It returns a new network of the same type and performs generic balancing by providing a rebalancing function.
-
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.
Header: mockturtle/algorithms/balancing/esop_balancing.hpp
-
template<class Ntk>
struct esop_rebalancing